RSB  0.12.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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...
 
- 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 52 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 81 of file Server.cpp.

References informer, and makeInformer().

Here is the call graph for this function:

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

Returns the configuration for the Informer participant.

Definition at line 89 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 64 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 72 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.

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 93 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 76 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 115 of file Server.h.

Referenced by deactivate(), and getInformer().

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

Definition at line 112 of file Server.h.

Referenced by getInformerConfig().

ListenerPtr rsb::patterns::Method::listener
private

Definition at line 114 of file Server.h.

Referenced by deactivate(), and getListener().

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

Definition at line 111 of file Server.h.

Referenced by getListenerConfig().

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

Definition at line 109 of file Server.h.

Referenced by getName().


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