RSB  0.17.0
rsb::converter Namespace Reference

Classes

class  AlwaysApplicable
 A predicate that unconditionally causes its associated Converter to be selected. More...
 
class  BoolConverter
 Converter for bool. More...
 
class  ByteArrayConverter
 "Converts" arbitrary payloads into a std::string which should be interpreted as an array of bytes. More...
 
class  Converter
 
class  ConverterPredicate
 Implementations of this interface can be used to perform Converter selection based on predicate evaluation. More...
 
class  ConverterSelectionStrategy
 Implementation of this interface perform mappings of one of the followings forms: More...
 
class  DoubleConverter
 Converter for double type. More...
 
class  EventIdConverter
 A converter for EventId. More...
 
class  EventsByScopeMapConverter
 A converter for aggregated events ordered by their scope and time for each scope. More...
 
class  FloatConverter
 Converter for float type. More...
 
class  FloatingPointConverter
 Base class for floating point type converters. More...
 
class  Int32Converter
 Converter for boost::int32_t. More...
 
class  Int64Converter
 Converter for boost::int64_t. More...
 
class  IntegerConverter
 Base class for integer type converters. More...
 
class  PredicateConverterList
 Objects of this class are used to perform Converter selection via a chain-of-responsibility strategy. More...
 
class  ProtocolBufferConverter
 A generic converter for data types based on Protocol Buffer messages. More...
 
class  RegexConverterPredicate
 Objects of this class select Converter s by matching the query wire-schema or data-type against a sotred reqular expression. More...
 
class  Repository
 Maintains a collection of converters for a specific wire format. More...
 
class  RepositoryCreater
 An internal factory object to create typed converter repositories. More...
 
class  RosettaConverter
 
class  SchemaAndByteArrayConverter
 "Converts" arbitrary payloads into a pair consisting of the original wire schema and a std::string which should be interpreted as an array of bytes. More...
 
class  ScopeConverter
 (De)serializes rsb::Scope objects. More...
 
class  SerializationException
 An exception indicating a serialization or deserialization problem for data. More...
 
class  StringConverter
 Converts any string into any string serializing content to a string. More...
 
class  TypeBasedRepositoryCreater
 A RepositoryCreate which can be statically typed using a template argument for the desired wire type. More...
 
class  TypeNameConverterPredicate
 Objects of this class select Converter s by matching the query wire-schema or data-type against a stored string. More...
 
class  Uint32Converter
 Converter for boost::uint32_t. More...
 
class  Uint64Converter
 Converter for boost::uint64_t. More...
 
class  UnambiguousConverterMap
 Objects this class store mappings of one of the followings forms. More...
 
class  VoidConverter
 Fulfill the interface... More...
 

Typedefs

typedef boost::shared_ptr< BoolConverterBoolConverterPtr
 
typedef boost::shared_ptr< ConverterPredicateConverterPredicatePtr
 
typedef boost::shared_ptr< VoidConverterVoidConverterPtr
 

Functions

void registerDefaultConverters ()
 
Repository< string >::Ptr stringConverterRepository ()
 
template<class WireType >
Repository< WireType >::Ptr converterRepository ()
 Returns a Repository of Converter instances specifically for the given wire type. More...
 
internal repository implementation

All this is done so that the memory of Repositories is maintained inside the RSB DLL on windows.

Otherwise multiple clients would have different instances of the repositories.

Moreover, I have added a general name-based lookup for repositories instead of being fixed to wire types (c++ types) as this might become a scalability problem later. We might find out that e.g. several connectors use string as their data type and still converters need to be fundamentally different. For this purpose general name-based lookup is possible now. So far only internally and the type-based methods map to this mechanism by using RTTI names.

Todo:
somehow find out if we can get rid of all the void pointer handling. right now I am missing a replacement of reinterpret_cast for shared_ptrs. The underlying problem is that Converter uses references and hence no Repository<void> can be declared as a polymorphic base type for the generic handling by name
void * converterRepositoryByName (const std::string &wireTypeName, RepositoryCreater &creater)
 Returns a repository for a converters of a certain wire type by a look up based on a name for the wire type. More...
 

Variables

static bool registered = false
 
static boost::mutex registrationMutex
 
static map< string, void * > repositoriesByName
 
static boost::mutex repositoriesByNameMutex
 

Typedef Documentation

typedef boost::shared_ptr<BoolConverter> rsb::converter::BoolConverterPtr

Definition at line 59 of file BoolConverter.h.

Definition at line 65 of file PredicateConverterList.h.

typedef boost::shared_ptr<VoidConverter> rsb::converter::VoidConverterPtr

Definition at line 56 of file VoidConverter.h.

Function Documentation

template<class WireType >
Repository<WireType>::Ptr rsb::converter::converterRepository ( )

Returns a Repository of Converter instances specifically for the given wire type.

Template Parameters
WireTypetype of the wire to serialize to / from
Returns
converter repository

Definition at line 345 of file Repository.h.

References converterRepositoryByName().

Here is the call graph for this function:

RSB_EXPORT void * rsb::converter::converterRepositoryByName ( const std::string &  wireTypeName,
RepositoryCreater creater 
)

Returns a repository for a converters of a certain wire type by a look up based on a name for the wire type.

Parameters
wireTypeNameof of the wire type.
createrif no repository exists with this name, this object is used to instantiate a new one.
Returns
converter repository.
Note
currently an internal method. Do not use it.

Definition at line 41 of file Repository.cpp.

References rsb::converter::RepositoryCreater::create().

Referenced by converterRepository().

Here is the call graph for this function:

Here is the caller graph for this function:

RSB_EXPORT void rsb::converter::registerDefaultConverters ( )

Definition at line 50 of file converters.cpp.

Referenced by rsb::Factory::Factory().

Here is the caller graph for this function:

Repository<string>::Ptr rsb::converter::stringConverterRepository ( )

Definition at line 50 of file Repository.cpp.

Variable Documentation

bool rsb::converter::registered = false
static

Definition at line 47 of file converters.cpp.

boost::mutex rsb::converter::registrationMutex
static

Definition at line 48 of file converters.cpp.

map<string, void*> rsb::converter::repositoriesByName
static

Definition at line 38 of file Repository.cpp.

boost::mutex rsb::converter::repositoriesByNameMutex
static

Definition at line 39 of file Repository.cpp.