RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::ParticipantConfig Class Reference

A class describing the configuration of Participant instances. More...

#include <ParticipantConfig.h>

Inheritance diagram for rsb::ParticipantConfig:
Inheritance graph
Collaboration diagram for rsb::ParticipantConfig:
Collaboration graph

Classes

class  EventProcessingStrategy
 Instances of this class describe the selection and configuration of an event processing strategy. More...
 
class  Transport
 Description of a desired transport. More...
 

Public Types

enum  ErrorStrategy { ERROR_STRATEGY_LOG, ERROR_STRATEGY_PRINT, ERROR_STRATEGY_EXIT }
 Possible error handling strategies in user-provided code like event handlers. More...
 

Public Member Functions

 ParticipantConfig ()
 Constructs a new empty configuration using the default QoS settings and #LOG as error strategy. More...
 
virtual ~ParticipantConfig ()
 
QualityOfServiceSpec getQualityOfServiceSpec () const
 Returns the current settings for QoS. More...
 
QualityOfServiceSpecmutableQualityOfServiceSpec ()
 Returns mutable quality of service settings. More...
 
void setQualityOfServiceSpec (const QualityOfServiceSpec &spec)
 Sets the desired QoS settings. More...
 
ErrorStrategy getErrorStrategy () const
 Returns the selected error strategy for the configured participant. More...
 
void setErrorStrategy (const ErrorStrategy &strategy)
 Sets the desired error strategy for the participant. More...
 
std::set< TransportgetTransports (bool includeDisabled=false) const
 Returns the set of desired transports for a participant. More...
 
Transport getTransport (const std::string &name) const
 Returns an immutable copy of a single configured transport. More...
 
TransportmutableTransport (const std::string &name)
 Returns a single configured transport which can be modified in place. More...
 
void addTransport (const Transport &transport)
 Adds a transport to the list of desired transport mechanisms. More...
 
void removeTransport (const Transport &transport)
 Removes a transport from the list of desired transports if it was present. More...
 
void setTransports (const std::set< Transport > &transports)
 Sets all desired transports in this configuration. More...
 
const EventProcessingStrategygetEventReceivingStrategy () const
 
EventProcessingStrategymutableEventReceivingStrategy ()
 
const EventProcessingStrategygetEventSendingStrategy () const
 
rsc::runtime::Properties getOptions () const
 Returns additional options besides the transport-specific ones. More...
 
rsc::runtime::Properties & mutableOptions ()
 Returns a mutable reference to the freestyle options in this configuration. More...
 
void setOptions (const rsc::runtime::Properties &options)
 Sets the additional options besides the transport-specific ones. More...
 

Private Member Functions

void handleOption (const std::vector< std::string > &key, const std::string &value)
 
void printContents (std::ostream &stream) const
 

Private Attributes

rsc::logging::LoggerPtr logger
 
QualityOfServiceSpec qosSpec
 
ErrorStrategy errorStrategy
 
std::map< std::string, Transporttransports
 
EventProcessingStrategy eventReceivingStrategy
 
EventProcessingStrategy eventSendingStrategy
 
rsc::runtime::Properties options
 

Detailed Description

A class describing the configuration of Participant instances.

This contains:

Author
jwienke
jmoringe

Definition at line 61 of file ParticipantConfig.h.

Member Enumeration Documentation

Possible error handling strategies in user-provided code like event handlers.

Author
jwienke
Enumerator
ERROR_STRATEGY_LOG 

Logs a message using the logging mechanism.

ERROR_STRATEGY_PRINT 

Uses stderr for printing a message.

ERROR_STRATEGY_EXIT 

exits the program.

Definition at line 205 of file ParticipantConfig.h.

Constructor & Destructor Documentation

rsb::ParticipantConfig::ParticipantConfig ( )

Constructs a new empty configuration using the default QoS settings and #LOG as error strategy.

Definition at line 179 of file ParticipantConfig.cpp.

rsb::ParticipantConfig::~ParticipantConfig ( )
virtual

Definition at line 186 of file ParticipantConfig.cpp.

Member Function Documentation

void rsb::ParticipantConfig::addTransport ( const Transport transport)

Adds a transport to the list of desired transport mechanisms.

Parameters
transportconfig of the transport

Definition at line 240 of file ParticipantConfig.cpp.

References rsb::ParticipantConfig::Transport::getName(), and transports.

Referenced by rsb::Factory::Factory(), and handleOption().

Here is the call graph for this function:

Here is the caller graph for this function:

ParticipantConfig::ErrorStrategy rsb::ParticipantConfig::getErrorStrategy ( ) const

Returns the selected error strategy for the configured participant.

Returns
strategy to use

Definition at line 202 of file ParticipantConfig.cpp.

References errorStrategy.

const ParticipantConfig::EventProcessingStrategy & rsb::ParticipantConfig::getEventReceivingStrategy ( ) const

Definition at line 256 of file ParticipantConfig.cpp.

References eventReceivingStrategy.

const ParticipantConfig::EventProcessingStrategy & rsb::ParticipantConfig::getEventSendingStrategy ( ) const

Definition at line 264 of file ParticipantConfig.cpp.

References eventSendingStrategy.

rsc::runtime::Properties rsb::ParticipantConfig::getOptions ( ) const

Returns additional options besides the transport-specific ones.

Returns
copy of additional options

Definition at line 268 of file ParticipantConfig.cpp.

References options.

Referenced by rsb::ParticipantConfig::Transport::isEnabled(), and rsb::ParticipantConfig::Transport::setEnabled().

Here is the caller graph for this function:

QualityOfServiceSpec rsb::ParticipantConfig::getQualityOfServiceSpec ( ) const

Returns the current settings for QoS.

Returns
quality of service settings as immutable copy

Definition at line 189 of file ParticipantConfig.cpp.

References qosSpec.

ParticipantConfig::Transport rsb::ParticipantConfig::getTransport ( const std::string &  name) const

Returns an immutable copy of a single configured transport.

Parameters
namename of the transport to get
Returns
copy of the transport
Exceptions
rsc::runtime::NoSuchObjectno such transport available with the given name

Definition at line 210 of file ParticipantConfig.cpp.

References transports.

set< ParticipantConfig::Transport > rsb::ParticipantConfig::getTransports ( bool  includeDisabled = false) const

Returns the set of desired transports for a participant.

Parameters
includeDisabledIf true, include transports that have been disabled via configuration options.
Returns
set of transports identified by strings
Note
generates a copy. Changing the returned object does not change this configuration

Definition at line 226 of file ParticipantConfig.cpp.

References logger, and transports.

Referenced by rsb::Factory::createInPullConnectors(), rsb::Factory::createInPushConnectors(), rsb::Factory::createOutConnectors(), rsb::Factory::Factory(), and printContents().

Here is the caller graph for this function:

ParticipantConfig::EventProcessingStrategy & rsb::ParticipantConfig::mutableEventReceivingStrategy ( )

Definition at line 260 of file ParticipantConfig.cpp.

References eventReceivingStrategy.

rsc::runtime::Properties & rsb::ParticipantConfig::mutableOptions ( )

Returns a mutable reference to the freestyle options in this configuration.

Returns
mutable reference to additional options

Definition at line 272 of file ParticipantConfig.cpp.

References options.

QualityOfServiceSpec & rsb::ParticipantConfig::mutableQualityOfServiceSpec ( )

Returns mutable quality of service settings.

Returns
reference to QoS settings

Definition at line 193 of file ParticipantConfig.cpp.

References qosSpec.

ParticipantConfig::Transport & rsb::ParticipantConfig::mutableTransport ( const std::string &  name)

Returns a single configured transport which can be modified in place.

Parameters
namename of the transport to get
Returns
reference to the transport
Exceptions
rsc::runtime::NoSuchObjectno such transport available with the given name

Definition at line 218 of file ParticipantConfig.cpp.

References transports.

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

Here is the caller graph for this function:

void rsb::ParticipantConfig::printContents ( std::ostream &  stream) const
private

Definition at line 378 of file ParticipantConfig.cpp.

References errorStrategy, eventReceivingStrategy, eventSendingStrategy, getTransports(), options, and qosSpec.

Here is the call graph for this function:

void rsb::ParticipantConfig::removeTransport ( const Transport transport)

Removes a transport from the list of desired transports if it was present.

Parameters
transportto remove

Definition at line 245 of file ParticipantConfig.cpp.

References rsb::ParticipantConfig::Transport::getName(), and transports.

Here is the call graph for this function:

void rsb::ParticipantConfig::setErrorStrategy ( const ErrorStrategy strategy)

Sets the desired error strategy for the participant.

Definition at line 206 of file ParticipantConfig.cpp.

References errorStrategy.

void rsb::ParticipantConfig::setOptions ( const rsc::runtime::Properties &  options)

Sets the additional options besides the transport-specific ones.

Parameters
optionsnew options replacing all old ones

Definition at line 276 of file ParticipantConfig.cpp.

References options.

Referenced by rsb::ParticipantConfig::Transport::setEnabled().

Here is the caller graph for this function:

void rsb::ParticipantConfig::setQualityOfServiceSpec ( const QualityOfServiceSpec spec)

Sets the desired QoS settings.

Parameters
specnew settings

Definition at line 197 of file ParticipantConfig.cpp.

References qosSpec.

void rsb::ParticipantConfig::setTransports ( const std::set< Transport > &  transports)

Sets all desired transports in this configuration.

Parameters
transportsset of transports

Definition at line 249 of file ParticipantConfig.cpp.

Member Data Documentation

ErrorStrategy rsb::ParticipantConfig::errorStrategy
private
EventProcessingStrategy rsb::ParticipantConfig::eventReceivingStrategy
private
EventProcessingStrategy rsb::ParticipantConfig::eventSendingStrategy
private

Definition at line 348 of file ParticipantConfig.h.

Referenced by getEventSendingStrategy(), handleOption(), and printContents().

rsc::logging::LoggerPtr rsb::ParticipantConfig::logger
private

Definition at line 342 of file ParticipantConfig.h.

Referenced by getTransports().

QualityOfServiceSpec rsb::ParticipantConfig::qosSpec
private
std::map<std::string, Transport> rsb::ParticipantConfig::transports
private

The documentation for this class was generated from the following files: