RSB
0.15.1
|
A informer to publish data of a specified type expressed through the template parameter. More...
#include <Informer.h>
Public Types | |
typedef boost::shared_ptr< Informer< T > > | Ptr |
Shared pointer type for this informer. More... | |
typedef boost::shared_ptr< T > | DataPtr |
Shared pointer type for the default data published by this informer. More... | |
Public Member Functions | |
Informer (const std::vector< transport::OutConnectorPtr > &connectors, const Scope &scope, const ParticipantConfig &config, const std::string &type=detail::TypeName< T >()()) | |
Constructs a new informer. More... | |
virtual | ~Informer () |
std::string | getClassName () const |
EventPtr | createEvent () const |
Creates a new Event instance filled with the scope from this informer. More... | |
EventPtr | publish (boost::shared_ptr< T > data) |
Publishes data to the Informer's scope. More... | |
template<class T1 > | |
EventPtr | publish (boost::shared_ptr< T1 > data, std::string type=rsc::runtime::typeName(typeid(T1))) |
EventPtr | publish (EventPtr event) |
Public Member Functions inherited from rsb::InformerBase | |
InformerBase (const std::vector< transport::OutConnectorPtr > &connectors, const Scope &scope, const ParticipantConfig &config, const std::string &defaultType) | |
virtual | ~InformerBase () |
void | printContents (std::ostream &stream) const |
virtual std::string | getKind () const |
Return the kind of the participant. More... | |
virtual const std::set< std::string > | getTransportURLs () const |
TODO. More... | |
std::string | getType () const |
Return the event payload type of this Informer. More... | |
void | setQualityOfSerivceSpecs (const QualityOfServiceSpec &specs) |
Defines the desired quality of service settings for this informers. More... | |
template<class T1 > | |
EventPtr | publish (boost::shared_ptr< T1 > data, std::string type=rsc::runtime::typeName< T1 >()) |
Published data in the channel in which the informer participates. More... | |
template<class T1 > | |
EventPtr | uncheckedPublish (boost::shared_ptr< T1 > data, const std::string &type=rsc::runtime::typeName< T1 >()) |
EventPtr | publish (VoidPtr data, const std::string &type) |
Publishes data to the Informer's scope. More... | |
EventPtr | uncheckedPublish (VoidPtr data, const std::string &type) |
EventPtr | publish (EventPtr event) |
Publishes the event to the Informer's scope with the ability to define additional meta data. More... | |
Public Member Functions inherited from rsb::Participant | |
virtual | ~Participant () |
void | printContents (std::ostream &stream) const |
rsc::misc::UUID | getId () const |
Returns the unique id of the participant. More... | |
ScopePtr | getScope () const |
Returns the scope of this participant. More... | |
ParticipantConfig | getConfig () const |
Returns a copy of the participant's configuration. More... | |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
Additional Inherited Members | |
Protected Member Functions inherited from rsb::InformerBase | |
void | checkedPublish (EventPtr event) |
void | uncheckedPublish (EventPtr event) |
boost::uint32_t | nextSequenceNumber () |
Protected Member Functions inherited from rsb::Participant | |
Participant (const Scope &scope, const ParticipantConfig &config) | |
Protected Attributes inherited from rsb::InformerBase | |
std::string | defaultType |
eventprocessing::OutRouteConfiguratorPtr | configurator |
A informer to publish data of a specified type expressed through the template parameter.
All data in RSB is maintained as shared pointers to avoid unnecessary copy operations. Typedefs simplify the use of the pointer types.
The basic usage pattern is explained with this example code:
T | Data type to send by this informer. |
Definition at line 236 of file Informer.h.
typedef boost::shared_ptr<T> rsb::Informer< T >::DataPtr |
Shared pointer type for the default data published by this informer.
Definition at line 247 of file Informer.h.
typedef boost::shared_ptr<Informer<T> > rsb::Informer< T >::Ptr |
Shared pointer type for this informer.
Definition at line 242 of file Informer.h.
|
inline |
Constructs a new informer.
connectors | A list of connectors the informer should use to connect to the bus |
scope | the scope under which the data are published |
config | the config that was used to setup this informer |
type | string describing the type of data sent by this informer. The empty string indicates that data of arbitrary type can be sent through this informer. |
Definition at line 263 of file Informer.h.
|
inlinevirtual |
Definition at line 270 of file Informer.h.
|
inlinevirtual |
Creates a new Event instance filled with the scope from this informer.
Moreover, this version also sets the type according to the template parameter of Informer.
Reimplemented from rsb::InformerBase.
Definition at line 285 of file Informer.h.
References rsb::InformerBase::createEvent().
|
inline |
Definition at line 273 of file Informer.h.
|
inline |
Publishes data to the Informer's scope.
data | Pointer to the data to send. |
Definition at line 298 of file Informer.h.
References rsb::InformerBase::publish().
|
inline |
Definition at line 304 of file Informer.h.
References rsb::InformerBase::publish().
|
inline |
Definition at line 309 of file Informer.h.
References rsb::InformerBase::publish().
|
private |
Definition at line 313 of file Informer.h.