RSB  0.9.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::patterns::Server<> Class Template Referenceabstract

The server side of a request-reply-based communication channel. More...

#include <Server.h>

Inheritance diagram for rsb::patterns::Server<>:
Inheritance graph
Collaboration diagram for rsb::patterns::Server<>:
Collaboration graph

Classes

class  AnyReplyTypeCallback
 A callback which allows any kind of reply type but is restricted to a single request type. More...
 
class  Callback
 Callback object used to register one method for a server. More...
 
class  Callback< RequestType, void >
 
class  Callback< void, ReplyType >
 
class  CallbackBase
 Base class for callback classes. More...
 
class  IntlCallback
 Callback object interface to implement for registering callable methods. More...
 

Public Types

typedef boost::shared_ptr
< IntlCallback
CallbackPtr
 

Public Member Functions

 Server (const Scope &scope, const ParticipantConfig &listenerConfig, const ParticipantConfig &informerConfig)
 
virtual ~Server ()
 
void registerMethod (const std::string &methodName, CallbackPtr callback)
 Register a new method with the given name. More...
 
 Callback ()
 
virtual void call (const std::string &methodName)=0
 Implement this method to perform actions. More...
 

Private Member Functions

AnnotatedData intlCall (const std::string &methodName, boost::shared_ptr< void >)
 

Private Attributes

Scope scope
 
ParticipantConfig listenerConfig
 
ParticipantConfig informerConfig
 
std::set< ListenerPtrrequestListeners
 
std::map< std::string,
Informer< AnyType >::Ptr > 
methods
 

Detailed Description

template<>
class rsb::patterns::Server<>

The server side of a request-reply-based communication channel.

A callback which does not take a request and does not produce a result.

Author
jwienke
jmoringe.

Definition at line 54 of file Server.h.

Member Typedef Documentation

typedef boost::shared_ptr<IntlCallback> rsb::patterns::Server<>::CallbackPtr

Definition at line 229 of file Server.h.

Constructor & Destructor Documentation

rsb::patterns::Server<>::Server ( const Scope scope,
const ParticipantConfig listenerConfig,
const ParticipantConfig informerConfig 
)

Definition at line 121 of file Server.cpp.

rsb::patterns::Server<>::~Server ( )
virtual

Definition at line 127 of file Server.cpp.

Member Function Documentation

virtual void rsb::patterns::Server<>::call ( const std::string &  methodName)
pure virtual

Implement this method to perform actions.

Parameters
methodNamecalled method
Exceptions
std::exceptionall exceptions based on this type are automatically caught and delivered to the remote server

Definition at line 270 of file Server.h.

AnnotatedData rsb::patterns::Server<>::intlCall ( const std::string &  methodName,
boost::shared_ptr< void >   
)
inlineprivate

Definition at line 285 of file Server.h.

void rsb::patterns::Server<>::registerMethod ( const std::string &  methodName,
CallbackPtr  callback 
)

Register a new method with the given name.

Parameters
methodNamemethod name
callbackcallback to execute for the method
Exceptions
MethodExistsExceptionthrown if a method with this name already exists

Definition at line 130 of file Server.cpp.

References rsb::Scope::concat(), rsb::Factory::createInformer(), rsb::Factory::createListener(), rsb::getFactory(), rsb::patterns::Server<>::informerConfig, rsb::patterns::Server<>::listenerConfig, rsb::patterns::Server<>::methods, rsb::patterns::Server<>::requestListeners, rsb::patterns::Server<>::scope, and rsb::Scope::toString().

Here is the call graph for this function:

Member Data Documentation

ParticipantConfig rsb::patterns::Server<>::informerConfig
private

Definition at line 248 of file Server.h.

Referenced by rsb::patterns::Server<>::registerMethod().

ParticipantConfig rsb::patterns::Server<>::listenerConfig
private

Definition at line 247 of file Server.h.

Referenced by rsb::patterns::Server<>::registerMethod().

std::map<std::string, Informer<AnyType>::Ptr> rsb::patterns::Server<>::methods
private

Definition at line 252 of file Server.h.

Referenced by rsb::patterns::Server<>::registerMethod().

std::set<ListenerPtr> rsb::patterns::Server<>::requestListeners
private

Definition at line 250 of file Server.h.

Referenced by rsb::patterns::Server<>::registerMethod().

Scope rsb::patterns::Server<>::scope
private

Definition at line 246 of file Server.h.

Referenced by rsb::patterns::Server<>::registerMethod().


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