RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Repository.h File Reference
#include <string>
#include <stdexcept>
#include <set>
#include <iomanip>
#include <boost/format.hpp>
#include <rsc/runtime/Printable.h>
#include <rsc/runtime/TypeStringTools.h>
#include <rsc/runtime/NoSuchObject.h>
#include <rsc/logging/Logger.h>
#include "Converter.h"
#include "ConverterSelectionStrategy.h"
#include "UnambiguousConverterMap.h"
#include "rsb/rsbexports.h"
Include dependency graph for Repository.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rsb::converter::Repository< WireType >
 Maintains a collection of converters for a specific wire format. More...
class  rsb::converter::RepositoryCreater
 An internal factory object to create typed converter repositories. More...
class  rsb::converter::TypeBasedRepositoryCreater< WireType >
 A RepositoryCreate which can be statically typed using a template argument for the desired wire type. More...

Namespaces

namespace  rsb
namespace  rsb::converter

Functions

template<class WireType >
Repository< WireType >::Ptr rsb::converter::converterRepository ()
 Returns a Repository of Converter instances specifically for the given wire type.
 rsb::converter::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 * 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.