RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::converter Namespace Reference

Namespaces

namespace  detail

Classes

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  ConverterSelectionStrategy
 Implementation of this interface perform mappings of one of the followings forms: 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  ConverterPredicate
 Implementations of this interface can be used to perform Converter selection based on predicate evaluation. More...
class  AlwaysApplicable
 A predicate that unconditionally causes its associated Converter to be selected. More...
class  PredicateConverterList
 Objects of this class are used to perform Converter selection via a chain-of-responsibility strategy. More...
class  ProtocolBufferConverter
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  TypeBasedRepositoryCreater
 A RepositoryCreate which can be statically typed using a template argument for the desired wire type. 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  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  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 uint32 types. More...
class  Uint64Converter
 Converter for uint64 types. 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
< BoolConverter
BoolConverterPtr
typedef boost::shared_ptr
< ConverterPredicate
ConverterPredicatePtr
typedef boost::shared_ptr
< Uint32Converter
Uint32ConverterPtr
typedef boost::shared_ptr
< Uint64Converter
Uint64ConverterPtr
typedef boost::shared_ptr
< VoidConverter
VoidConverterPtr

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.
 DEPRECATED (RSB_EXPORT Repository< std::string >::Ptr stringConverterRepository())
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.

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.

Definition at line 59 of file Uint32Converter.h.

Definition at line 59 of file Uint64Converter.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 305 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(), repositoriesByName, and repositoriesByNameMutex.

Referenced by converterRepository().

Here is the call graph for this function:

Here is the caller graph for this function:

rsb::converter::DEPRECATED ( RSB_EXPORT Repository< std::string >::Ptr   stringConverterRepository())
Deprecated:
use converterRepository() instead
Returns
converter repository for converters that converter to std::string wires
RSB_EXPORT void rsb::converter::registerDefaultConverters ( )

Definition at line 49 of file converters.cpp.

References registered, and registrationMutex.

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
boost::mutex rsb::converter::registrationMutex
static
map<string, void*> rsb::converter::repositoriesByName
static

Definition at line 38 of file Repository.cpp.

Referenced by converterRepositoryByName().

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

Definition at line 39 of file Repository.cpp.

Referenced by converterRepositoryByName().