RSB  0.19.0
rsb::patterns::Method Class Reference

Base class for method classes. More...

#include <Server.h>

Inheritance diagram for rsb::patterns::Method:
Inheritance graph
Collaboration diagram for rsb::patterns::Method:
Collaboration graph

Public Member Functions

 Method (const Scope &scope, const std::string &name, const ParticipantConfig &listenerConfig, const ParticipantConfig &informerConfig)
 
virtual ~Method ()
 
void activate ()
 
void deactivate ()
 
const std::string & getName () const
 Returns the name of the method. More...
 
virtual const std::set< std::string > getTransportURLs () const
 TODO. More...
 
- Public Member Functions inherited from rsb::Participant
virtual ~Participant ()
 
void printContents (std::ostream &stream) const
 
virtual std::string getKind () const =0
 Return the kind of the participant. More...
 
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...
 
- Public Member Functions inherited from rsb::Handler
std::set< std::string > getMethods () const
 Returns the desired set of methods this handler can handle. More...
 
bool acceptsMethod (const std::string &method) const
 
- Public Member Functions inherited from rsb::eventprocessing::Handler
virtual void handle (EventPtr event)=0
 Handle event. More...
 

Protected Member Functions

ListenerPtr getListener ()
 Returns the Listener participant, creating it if necessary. More...
 
const ParticipantConfiggetListenerConfig () const
 Returns the configuration for the Listener participant. More...
 
virtual ListenerPtr makeListener ()
 Creates and returns the Listener participant. More...
 
InformerBasePtr getInformer ()
 Returns the Informer participant, creating it if necessary. More...
 
const ParticipantConfiggetInformerConfig () const
 Returns the configuration for the Informer participant. More...
 
virtual InformerBasePtr makeInformer ()
 Creates and returns the Informer participant. More...
 
- Protected Member Functions inherited from rsb::Participant
 Participant (const Scope &scope, const ParticipantConfig &config)
 
- Protected Member Functions inherited from rsb::Handler
 Handler (const std::string &method="")
 Creates a new handler that only accepts events for the specified method. More...
 
 Handler (const std::set< std::string > &methods)
 Creates a new handler that only accepts events with the specified methods. More...
 
virtual ~Handler ()
 
std::string getClassName () const
 

Private Attributes

std::string name
 
ParticipantConfig listenerConfig
 
ParticipantConfig informerConfig
 
ListenerPtr listener
 
InformerBasePtr informer
 

Detailed Description

Base class for method classes.

Manages a listener and an informer participant and their respective configurations.

Author
jmoringe

Definition at line 55 of file Server.h.

Constructor & Destructor Documentation

rsb::patterns::Method::Method ( const Scope scope,
const std::string &  name,
const ParticipantConfig listenerConfig,
const ParticipantConfig informerConfig 
)

Definition at line 34 of file Server.cpp.

rsb::patterns::Method::~Method ( )
virtual

Definition at line 42 of file Server.cpp.

References deactivate().

Here is the call graph for this function:

Member Function Documentation

void rsb::patterns::Method::activate ( )

Definition at line 46 of file Server.cpp.

References getListener().

Here is the call graph for this function:

void rsb::patterns::Method::deactivate ( )

Definition at line 50 of file Server.cpp.

References informer, and listener.

Referenced by ~Method().

Here is the caller graph for this function:

InformerBasePtr rsb::patterns::Method::getInformer ( )
protected

Returns the Informer participant, creating it if necessary.

Definition at line 85 of file Server.cpp.

References informer, and makeInformer().

Referenced by rsb::patterns::RemoteServer::RemoteMethod::call(), and rsb::patterns::LocalServer<>::LocalMethod::handle().

Here is the call graph for this function:

Here is the caller graph for this function:

const ParticipantConfig & rsb::patterns::Method::getInformerConfig ( ) const
protected

Returns the configuration for the Informer participant.

Definition at line 93 of file Server.cpp.

References informerConfig.

Referenced by makeInformer().

Here is the caller graph for this function:

ListenerPtr rsb::patterns::Method::getListener ( )
protected

Returns the Listener participant, creating it if necessary.

Definition at line 68 of file Server.cpp.

References listener, and makeListener().

Referenced by activate().

Here is the call graph for this function:

Here is the caller graph for this function:

const ParticipantConfig & rsb::patterns::Method::getListenerConfig ( ) const
protected

Returns the configuration for the Listener participant.

Definition at line 76 of file Server.cpp.

References listenerConfig.

Referenced by makeListener().

Here is the caller graph for this function:

const std::string & rsb::patterns::Method::getName ( ) const

Returns the name of the method.

Definition at line 59 of file Server.cpp.

References name.

Referenced by rsb::patterns::LocalServer<>::LocalMethod::handle().

Here is the caller graph for this function:

const std::set< std::string > rsb::patterns::Method::getTransportURLs ( ) const
virtual

TODO.

Implements rsb::Participant.

Definition at line 63 of file Server.cpp.

InformerBasePtr rsb::patterns::Method::makeInformer ( )
protectedvirtual

Creates and returns the Informer participant.

Derived class can override this method to adapt the created instance.

Definition at line 97 of file Server.cpp.

References rsb::Factory::createInformerBase(), rsb::getFactory(), getInformerConfig(), and rsb::Participant::getScope().

Referenced by getInformer().

Here is the call graph for this function:

Here is the caller graph for this function:

ListenerPtr rsb::patterns::Method::makeListener ( )
protectedvirtual

Creates and returns the Listener participant.

Derived class can override this method to adapt the created instance.

Reimplemented in rsb::patterns::LocalServer<>::LocalMethod, and rsb::patterns::RemoteServer::RemoteMethod.

Definition at line 80 of file Server.cpp.

References rsb::Factory::createListener(), rsb::getFactory(), getListenerConfig(), and rsb::Participant::getScope().

Referenced by getListener(), rsb::patterns::RemoteServer::RemoteMethod::makeListener(), and rsb::patterns::LocalServer<>::LocalMethod::makeListener().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

InformerBasePtr rsb::patterns::Method::informer
private

Definition at line 121 of file Server.h.

Referenced by deactivate(), and getInformer().

ParticipantConfig rsb::patterns::Method::informerConfig
private

Definition at line 118 of file Server.h.

Referenced by getInformerConfig().

ParticipantConfig rsb::patterns::Method::listenerConfig
private

Definition at line 117 of file Server.h.

Referenced by getListenerConfig().

std::string rsb::patterns::Method::name
private

Definition at line 115 of file Server.h.

Referenced by getName().


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