RSB  0.19.0
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)
 Replaces all existing transports with the ones given here. More...
 
const EventProcessingStrategygetEventReceivingStrategy () const
 
EventProcessingStrategymutableEventReceivingStrategy ()
 
const EventProcessingStrategygetEventSendingStrategy () const
 
bool isIntrospectionEnabled () const
 Indicates whether introspection should be enabled for the participant. More...
 
void setIsIntrospectionEnabled (bool newValue)
 Controls whether introspection should be enabled for the participant. More...
 
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
 
bool introspection
 
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 178 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.

It will replace a potentially existing transport configuration for the same transport name.

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 257 of file ParticipantConfig.cpp.

References eventReceivingStrategy.

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

Definition at line 265 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 278 of file ParticipantConfig.cpp.

References options.

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.

Referenced by rsb::InformerBase::InformerBase(), rsb::Listener::initialize(), and rsb::Reader::Reader().

Here is the caller graph for this function:

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:

bool rsb::ParticipantConfig::isIntrospectionEnabled ( ) const

Indicates whether introspection should be enabled for the participant.

Returns
true if introspection should be enabled for the participant, false otherwise.

Definition at line 269 of file ParticipantConfig.cpp.

References introspection.

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

Definition at line 261 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 282 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 387 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::setIsIntrospectionEnabled ( bool  newValue)

Controls whether introspection should be enabled for the participant.

Parameters
newValueIf true, introspection should be enabled for the participant.

Definition at line 273 of file ParticipantConfig.cpp.

References introspection.

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 286 of file ParticipantConfig.cpp.

References options.

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)

Replaces all existing transports with the ones given here.

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 368 of file ParticipantConfig.h.

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

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

Definition at line 362 of file ParticipantConfig.h.

Referenced by getTransports().

rsc::runtime::Properties rsb::ParticipantConfig::options
private
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: