RSB
0.10.0
|
Factory for RSB user-level domain objects for communication patterns. More...
#include <Factory.h>
Public Member Functions | |
DEPRECATED (static Factory &getInstance()) | |
virtual | ~Factory () |
template<class DataType > | |
Informer< DataType >::Ptr | createInformer (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig(), const std::string &dataType=detail::TypeName< DataType >()()) |
Creates and returns a new Informer that publishes Event s under the Scope scope. | |
InformerBasePtr | createInformerBase (const Scope &scope, const std::string &dataType="", const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates and returns a new Informer that publishes Event s under the Scope scope. | |
ListenerPtr | createListener (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates a new listener for the specified scope. | |
ReaderPtr | createReader (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates a new Reader object for the specified scope. | |
ServicePtr | createService (const Scope &scope) |
Creates a Service instance operating on the given scope. | |
patterns::ServerPtr | createServer (const Scope &scope, const ParticipantConfig &listenerConfig=getFactory().getDefaultParticipantConfig(), const ParticipantConfig &informerConfig=getFactory().getDefaultParticipantConfig()) |
Creates a Server object that exposes methods under the scope scope. | |
patterns::RemoteServerPtr | createRemoteServer (const Scope &scope, const ParticipantConfig &listenerConfig=getFactory().getDefaultParticipantConfig(), const ParticipantConfig &informerConfig=getFactory().getDefaultParticipantConfig()) |
Creates a RemoteServer object for the server at scope scope. | |
ParticipantConfig | getDefaultParticipantConfig () const |
Returns the default configuration for new participants. | |
void | setDefaultParticipantConfig (const ParticipantConfig &config) |
Sets the default config for participants that will be used for every new participant that is created after this call. | |
rsc::plugins::ManagerPtr | getPluginManager () const |
Returns the plugin manager instance used by the RSB core. |
Private Member Functions | |
Factory () | |
Singleton constructor. | |
std::vector < transport::OutConnectorPtr > | createOutConnectors (const ParticipantConfig &config) |
std::vector < transport::InPullConnectorPtr > | createInPullConnectors (const ParticipantConfig &config) |
std::vector < transport::InPushConnectorPtr > | createInPushConnectors (const ParticipantConfig &config) |
void | configureSubsystem (rsc::config::OptionHandler &handler, const std::string &environmentVariablePrefix="RSB_") |
Static Private Member Functions | |
static Factory & | getInstanceBase () |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
rsc::plugins::ManagerPtr | pluginManager |
ParticipantConfig | defaultConfig |
Always acquire configMutex before reading or writing the config. | |
boost::recursive_mutex | configMutex |
Friends | |
class | rsc::patterns::Singleton< Factory > |
Factory & | getFactory () |
Returns a factory for client-level RSB objects. |
Factory for RSB user-level domain objects for communication patterns.
|
virtual |
Definition at line 250 of file Factory.cpp.
|
private |
Singleton constructor.
Definition at line 171 of file Factory.cpp.
References rsb::ParticipantConfig::addTransport(), defaultConfig, rsb::transport::getAvailableTransports(), rsb::ParticipantConfig::getTransports(), rsb::transport::IN_PULL, rsb::transport::IN_PUSH, rsb::ParticipantConfig::mutableTransport(), rsb::transport::OUT, pluginManager, rsb::converter::registerDefaultConverters(), rsb::eventprocessing::registerDefaultEventProcessingStrategies(), rsb::transport::registerDefaultTransports(), and rsb::ParticipantConfig::Transport::setEnabled().
|
private |
|
inline |
Creates and returns a new Informer that publishes Event s under the Scope scope.
DataType | the C++ data type this informer publishes |
scope | the scope of the informer |
config | the configuration for the informer to use, defaults to the general config held in this factory. |
dataType | A string representation of the type of data sent via the new Informer |
RSBError | If the requested informer cannot be created. |
Definition at line 99 of file Factory.h.
Referenced by rsb::createInformer(), rsb::patterns::RemoteServer::getMethodSet(), and rsb::patterns::Server<>::registerMethod().
InformerBasePtr rsb::Factory::createInformerBase | ( | const Scope & | scope, |
const std::string & | dataType = "" , |
||
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates and returns a new Informer that publishes Event s under the Scope scope.
scope | the scope of the informer |
dataType | A string representation of the type of data sent via the new Informer. |
config | The configuration for the informer to use, defaults to the general config held in this factory. |
RSBError | If the requested informer cannot be created. |
Definition at line 253 of file Factory.cpp.
References createOutConnectors().
Referenced by rsb::crateInformerBase().
|
private |
Definition at line 299 of file Factory.cpp.
References rsb::transport::getInPullFactory(), and rsb::ParticipantConfig::getTransports().
Referenced by createReader().
|
private |
Definition at line 322 of file Factory.cpp.
References rsb::transport::getInPushFactory(), and rsb::ParticipantConfig::getTransports().
Referenced by createListener().
ListenerPtr rsb::Factory::createListener | ( | const Scope & | scope, |
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a new listener for the specified scope.
scope | the scope of the new listener |
config | the configuration for the LISTENER to use, defaults to the general config held in this factory.f |
Definition at line 260 of file Factory.cpp.
References createInPushConnectors().
Referenced by rsb::createListener(), rsb::patterns::RemoteServer::getMethodSet(), and rsb::patterns::Server<>::registerMethod().
|
private |
Definition at line 345 of file Factory.cpp.
References rsb::transport::getOutFactory(), and rsb::ParticipantConfig::getTransports().
Referenced by createInformerBase().
ReaderPtr rsb::Factory::createReader | ( | const Scope & | scope, |
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a new Reader object for the specified scope.
Reader objects receive event via a pull-style interface by calls to Reader::read.
scope | the scope of the new receiver |
RSBError | when the requested connection cannot be established. |
Definition at line 265 of file Factory.cpp.
References createInPullConnectors().
Referenced by rsb::createReader().
patterns::RemoteServerPtr rsb::Factory::createRemoteServer | ( | const Scope & | scope, |
const ParticipantConfig & | listenerConfig = getFactory().getDefaultParticipantConfig() , |
||
const ParticipantConfig & | informerConfig = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a RemoteServer object for the server at scope scope.
scope | The scope at which the remote server object exposes itself. |
listenerConfig | configuration to use for all reply listeners |
informerConfig | configuration to use for all request informers |
Definition at line 277 of file Factory.cpp.
Referenced by rsb::createRemoteServer().
patterns::ServerPtr rsb::Factory::createServer | ( | const Scope & | scope, |
const ParticipantConfig & | listenerConfig = getFactory().getDefaultParticipantConfig() , |
||
const ParticipantConfig & | informerConfig = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a Server object that exposes methods under the scope scope.
scope | The scope under which the new server exposes its methods. |
listenerConfig | configuration to use for all request listeners |
informerConfig | configuration to use for all reply informers |
Definition at line 270 of file Factory.cpp.
Referenced by rsb::createServer().
ServicePtr rsb::Factory::createService | ( | const Scope & | scope | ) |
Creates a Service instance operating on the given scope.
scope | parent-scope of the new service |
Definition at line 294 of file Factory.cpp.
Referenced by rsb::createService().
rsb::Factory::DEPRECATED | ( | static Factory & | getInstance() | ) |
ParticipantConfig rsb::Factory::getDefaultParticipantConfig | ( | ) | const |
Returns the default configuration for new participants.
Definition at line 284 of file Factory.cpp.
References configMutex, and defaultConfig.
|
staticprivate |
Definition at line 167 of file Factory.cpp.
rsc::plugins::ManagerPtr rsb::Factory::getPluginManager | ( | ) | const |
Returns the plugin manager instance used by the RSB core.
Definition at line 367 of file Factory.cpp.
References pluginManager.
void rsb::Factory::setDefaultParticipantConfig | ( | const ParticipantConfig & | config | ) |
Sets the default config for participants that will be used for every new participant that is created after this call.
config | new config |
Definition at line 289 of file Factory.cpp.
References configMutex, and defaultConfig.
|
friend |
Returns a factory for client-level RSB objects.
Definition at line 163 of file Factory.cpp.
|
mutableprivate |
Definition at line 237 of file Factory.h.
Referenced by getDefaultParticipantConfig(), and setDefaultParticipantConfig().
|
private |
Always acquire configMutex before reading or writing the config.
Definition at line 236 of file Factory.h.
Referenced by Factory(), getDefaultParticipantConfig(), and setDefaultParticipantConfig().
|
private |
Definition at line 231 of file Factory.h.
Referenced by Factory(), and getPluginManager().