RSB  0.7.0
 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.
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)
 Registers the given converter in the collection.
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 203 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 200 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 196 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 208 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 178 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 192 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 212 of file Repository.h.

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

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

Registers the given converter in the collection.

Parameters
converterthe converter to register
Exceptions
std::invalid_argumentif there is already a converter registered with the same wire type or data type

Definition at line 163 of file Repository.h.

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

Member Data Documentation

template<class WireType>
rsc::logging::LoggerPtr rsb::converter::Repository< WireType >::logger
private

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