RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::converter::Repository< WireType > Class Template Reference

Maintains a collection of converters for a specific wire format. More...

#include <Repository.h>

Inheritance diagram for rsb::converter::Repository< WireType >:
Inheritance graph
Collaboration diagram for rsb::converter::Repository< WireType >:
Collaboration graph

Public Types

typedef Converter< WireType >::Ptr ConverterPtr
 
typedef std::pair< std::string,
std::string > 
ConverterSignature
 WireSchema and DataType. More...
 
typedef std::map< std::string,
std::string > 
ConverterSelectionMap
 
typedef boost::shared_ptr
< Repository< WireType > > 
Ptr
 

Public Member Functions

 Repository ()
 
ConverterSelectionStrategy
< WireType >::Ptr 
getConvertersForSerialization (const ConverterSelectionMap &selection=ConverterSelectionMap()) const
 
ConverterSelectionStrategy
< WireType >::Ptr 
getConvertersForDeserialization (const ConverterSelectionMap &selection=ConverterSelectionMap()) const
 
void registerConverter (ConverterPtr converter, bool replace=false)
 Registers converter in the collection. More...
 
ConverterPtr getConverter (const std::string &wireSchema, const std::string &dataType) const
 
ConverterPtr getConverter (const ConverterSignature &signature) const
 
void clear ()
 

Private Types

typedef std::map
< ConverterSignature,
ConverterPtr
ConverterMap
 

Private Member Functions

std::string getClassName () const
 
void printContents (std::ostream &stream) const
 

Private Attributes

rsc::logging::LoggerPtr logger
 
ConverterMap converters
 

Detailed Description

template<class WireType>
class rsb::converter::Repository< WireType >

Maintains a collection of converters for a specific wire format.

Each converter has a wire type describing the actual message that is written on the wire and a data type that indicates which data it can serialize on the wire.

Author
jwienke
Template Parameters
WireTypethe wire-type of the collected converters.

Definition at line 59 of file Repository.h.

Member Typedef Documentation

template<class WireType>
typedef std::map<ConverterSignature, ConverterPtr> rsb::converter::Repository< WireType >::ConverterMap
private

Definition at line 242 of file Repository.h.

template<class WireType>
typedef Converter<WireType>::Ptr rsb::converter::Repository< WireType >::ConverterPtr

Definition at line 61 of file Repository.h.

template<class WireType>
typedef std::map<std::string, std::string> rsb::converter::Repository< WireType >::ConverterSelectionMap

Definition at line 66 of file Repository.h.

template<class WireType>
typedef std::pair<std::string, std::string> rsb::converter::Repository< WireType >::ConverterSignature

WireSchema and DataType.

Definition at line 64 of file Repository.h.

template<class WireType>
typedef boost::shared_ptr<Repository<WireType> > rsb::converter::Repository< WireType >::Ptr

Definition at line 239 of file Repository.h.

Constructor & Destructor Documentation

template<class WireType>
rsb::converter::Repository< WireType >::Repository ( )
inline

Definition at line 68 of file Repository.h.

Member Function Documentation

template<class WireType>
void rsb::converter::Repository< WireType >::clear ( )
inline

Definition at line 235 of file Repository.h.

References rsb::converter::Repository< WireType >::converters.

template<class WireType>
std::string rsb::converter::Repository< WireType >::getClassName ( ) const
inlineprivate

Definition at line 247 of file Repository.h.

template<class WireType>
ConverterPtr rsb::converter::Repository< WireType >::getConverter ( const std::string &  wireSchema,
const std::string &  dataType 
) const
inline

Definition at line 217 of file Repository.h.

References rsb::converter::Repository< WireType >::converters.

Referenced by rsb::converter::Repository< WireType >::getConverter().

Here is the caller graph for this function:

template<class WireType>
ConverterPtr rsb::converter::Repository< WireType >::getConverter ( const ConverterSignature signature) const
inline

Definition at line 231 of file Repository.h.

References rsb::converter::Repository< WireType >::getConverter().

Here is the call graph for this function:

template<class WireType>
ConverterSelectionStrategy<WireType>::Ptr rsb::converter::Repository< WireType >::getConvertersForDeserialization ( const ConverterSelectionMap selection = ConverterSelectionMap()) const
inline
template<class WireType>
ConverterSelectionStrategy<WireType>::Ptr rsb::converter::Repository< WireType >::getConvertersForSerialization ( const ConverterSelectionMap selection = ConverterSelectionMap()) const
inline
template<class WireType>
void rsb::converter::Repository< WireType >::printContents ( std::ostream &  stream) const
inlineprivate

Definition at line 251 of file Repository.h.

References rsb::converter::Repository< WireType >::converters.

template<class WireType>
void rsb::converter::Repository< WireType >::registerConverter ( ConverterPtr  converter,
bool  replace = false 
)
inline

Registers converter in the collection.

Parameters
converterThe converter to register.
replaceIf a converter with the same wire schema and data type as converter is already registered, should it be replaced?
Exceptions
std::invalid_argumentIf there is already a converter registered with the same wire schema and data type.

Definition at line 199 of file Repository.h.

References rsb::converter::Repository< WireType >::converters, and rsb::converter::Repository< WireType >::logger.

Member Data Documentation


The documentation for this class was generated from the following file: