RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Repository.cpp File Reference
#include "Repository.h"
#include <map>
#include <boost/thread/mutex.hpp>
Include dependency graph for Repository.cpp:

Go to the source code of this file.

Namespaces

 rsb
 
 rsb::converter
 

Functions

Repository< string >::Ptr rsb::converter::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 * 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. More...
 

Variables

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