InstantIO::BasicCodec Class Reference

Abstract base class of all Codec templates. More...

#include <InstantIO/BasicCodec.h>

Inheritance diagram for InstantIO::BasicCodec:
InstantIO::Codec< T >

List of all members.

Public Types

typedef BasicEncoder *(* CreateEncoderMethod )()
 Defines a method that creates a new Encoder.
typedef BasicDecoder *(* CreateDecoderMethod )()
 Defines a method that creates a new Decoder.
typedef std::map< std::string,
BasicCodec * > 
CodecMap
 Defines the map of all codecs.

Public Member Functions

virtual ~BasicCodec ()
 Destroys the BasicCodec object.
const std::string & getLabel () const
 Returns the label of the Codec.
const std::string & getAuthor () const
 Returns the name of the person who wrote the Codec.
virtual const char * getTypeName () const =0
 Returns a human-readable string that describes the type that can be encoded and decoded by this Codec.
BasicEncodercreateEncoder () const
 Creates a new Encoder object.
BasicDecodercreateDecoder () const
 Creates a new Decoder object.
virtual bool sameType (const BasicOutSlot &outSlot) const =0
 Checks if a the Codec has the same type as a given OutSlot.
virtual bool sameType (const BasicInSlot &inSlot) const =0
 Checks if a the Codec has the same type as a given InSlot.

Static Public Member Functions

static BasicCodecfindCodec (const std::string &label)
 Returns the Codec that matches a given label.
static BasicCodecfindCodec (const BasicOutSlot &outSlot)
 Returns the Codec whose type matches the type of a given OutSlot.
static BasicCodecfindCodec (const BasicInSlot &inSlot)
 Returns the Codec whose type matches the type of a given InSlot.
static CodecMapgetCodecs ()
 Returns the map of all Codecs currently available.

Protected Member Functions

 BasicCodec (const std::string &label, CreateEncoderMethod createEncoderMethod, CreateDecoderMethod createDecoderMethod, const std::string &author=std::string())
 Creates a new BasicCodec object.

Detailed Description

Abstract base class of all Codec templates.

Author:
Patrick Dähne

Constructor & Destructor Documentation

InstantIO::BasicCodec::BasicCodec ( const std::string &  label,
CreateEncoderMethod  createEncoderMethod,
CreateDecoderMethod  createDecoderMethod,
const std::string &  author = std::string() 
) [protected]

Creates a new BasicCodec object.

Parameters:
label The label of the Codec. This label is used to identify the Codec. Case does not matter.
createEncoderMethod The method used to create new Encoders.
createDecoderMethod The method used to create new Decoders.
author The name of the person who wrote the codec. This information is not used by the InstantIO system in any way, it simply serves documentation purposes.

Member Function Documentation

const std::string& InstantIO::BasicCodec::getLabel (  )  const [inline]

Returns the label of the Codec.

This label is used to identify the Codec.

Returns:
The label of the Codec.
const std::string& InstantIO::BasicCodec::getAuthor (  )  const [inline]

Returns the name of the person who wrote the Codec.

This information is not used by the InstantIO system in any way, it simply serves documentation purposes.

Returns:
The name.
virtual const char* InstantIO::BasicCodec::getTypeName (  )  const [pure virtual]

Returns a human-readable string that describes the type that can be encoded and decoded by this Codec.

Returns:
A string that describes the type that can be encoded or decoded by this Codec.

Implemented in InstantIO::Codec< T >.

BasicEncoder* InstantIO::BasicCodec::createEncoder (  )  const [inline]

Creates a new Encoder object.

Returns:
The new Encoder object.
BasicDecoder* InstantIO::BasicCodec::createDecoder (  )  const [inline]

Creates a new Decoder object.

Returns:
The new Decoder object.
static BasicCodec* InstantIO::BasicCodec::findCodec ( const std::string &  label  )  [static]

Returns the Codec that matches a given label.

Parameters:
label The label of the Codec. Case does not matter.
Returns:
The Codec that matches the label or null when no such Codec exists.
static BasicCodec* InstantIO::BasicCodec::findCodec ( const BasicOutSlot outSlot  )  [static]

Returns the Codec whose type matches the type of a given OutSlot.

Parameters:
outSlot The OutSlot.
Returns:
The Codec whose type matches the type of the OutSlot or null when no such Codec exists.
static BasicCodec* InstantIO::BasicCodec::findCodec ( const BasicInSlot inSlot  )  [static]

Returns the Codec whose type matches the type of a given InSlot.

Parameters:
inSlot The InSlot.
Returns:
The Codec whose type matches the type of the InSlot or null when no such Codec exists.
virtual bool InstantIO::BasicCodec::sameType ( const BasicOutSlot outSlot  )  const [pure virtual]

Checks if a the Codec has the same type as a given OutSlot.

Parameters:
outSlot The OutSlot.
Returns:
true when the Codec and the OutSlot have the same type, false otherwise.

Implemented in InstantIO::Codec< T >.

virtual bool InstantIO::BasicCodec::sameType ( const BasicInSlot inSlot  )  const [pure virtual]

Checks if a the Codec has the same type as a given InSlot.

Parameters:
inSlot The InSlot.
Returns:
true when the Codec and the InSlot have the same type, false otherwise.

Implemented in InstantIO::Codec< T >.

static CodecMap* InstantIO::BasicCodec::getCodecs (  )  [inline, static]

Returns the map of all Codecs currently available.

Returns:
The map of all Codecs

The documentation for this class was generated from the following file:
Generated on Thu Jul 31 17:17:32 2014 by  doxygen 1.6.3