RSB  0.19.0
rsb::patterns::RemoteServer::RemoteMethod Class Reference

A derived Method class which can be used to invoke methods on a remote LocalServer object. More...

#include <RemoteServer.h>

Inheritance diagram for rsb::patterns::RemoteServer::RemoteMethod:
Inheritance graph
Collaboration diagram for rsb::patterns::RemoteServer::RemoteMethod:
Collaboration graph

Public Member Functions

 RemoteMethod (const Scope &scope, const std::string &name, const ParticipantConfig &listenerConfig, const ParticipantConfig &informerConfig)
 
virtual ~RemoteMethod ()
 
virtual std::string getKind () const
 Return the kind of the participant. More...
 
FuturePtr call (const std::string &methodName, EventPtr request)
 
- Public Member Functions inherited from rsb::patterns::Method
 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
 
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
 

Private Types

typedef boost::mutex MutexType
 

Private Member Functions

ListenerPtr makeListener ()
 Creates and returns the Listener participant. More...
 
void handle (EventPtr event)
 Handle event. More...
 

Private Attributes

rsc::logging::LoggerPtr logger
 
MutexType inprogressMutex
 
std::map< EventId, FuturePtrinprogress
 

Additional Inherited Members

- Protected Member Functions inherited from rsb::patterns::Method
ListenerPtr getListener ()
 Returns the Listener participant, creating it if necessary. More...
 
const ParticipantConfiggetListenerConfig () const
 Returns the configuration for 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
 

Detailed Description

A derived Method class which can be used to invoke methods on a remote LocalServer object.

Author
jmoringe

Definition at line 90 of file RemoteServer.h.

Member Typedef Documentation

Definition at line 103 of file RemoteServer.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file RemoteServer.cpp.

rsb::patterns::RemoteServer::RemoteMethod::~RemoteMethod ( )
virtual

Definition at line 62 of file RemoteServer.cpp.

Member Function Documentation

RemoteServer::FuturePtr rsb::patterns::RemoteServer::RemoteMethod::call ( const std::string &  methodName,
EventPtr  request 
)

Definition at line 76 of file RemoteServer.cpp.

References rsb::patterns::Method::getInformer(), rsb::Participant::getScope(), inprogress, and inprogressMutex.

Here is the call graph for this function:

std::string rsb::patterns::RemoteServer::RemoteMethod::getKind ( ) const
virtual

Return the kind of the participant.

Examples include "informer", "listener" and "reader".

Returns
a string describing the kind of the participant.

Implements rsb::Participant.

Definition at line 65 of file RemoteServer.cpp.

void rsb::patterns::RemoteServer::RemoteMethod::handle ( EventPtr  event)
privatevirtual

Handle event.

Parameters
eventThe event that should be handled.

Implements rsb::eventprocessing::Handler.

Definition at line 93 of file RemoteServer.cpp.

References inprogress, inprogressMutex, and logger.

ListenerPtr rsb::patterns::RemoteServer::RemoteMethod::makeListener ( )
privatevirtual

Creates and returns the Listener participant.

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

Reimplemented from rsb::patterns::Method.

Definition at line 69 of file RemoteServer.cpp.

References rsb::patterns::Method::listener, and rsb::patterns::Method::makeListener().

Here is the call graph for this function:

Member Data Documentation

std::map<EventId, FuturePtr> rsb::patterns::RemoteServer::RemoteMethod::inprogress
private

Definition at line 108 of file RemoteServer.h.

Referenced by call(), and handle().

MutexType rsb::patterns::RemoteServer::RemoteMethod::inprogressMutex
private

Definition at line 107 of file RemoteServer.h.

Referenced by call(), and handle().

rsc::logging::LoggerPtr rsb::patterns::RemoteServer::RemoteMethod::logger
private

Definition at line 105 of file RemoteServer.h.

Referenced by handle().


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