RSB  0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rsb::patterns::Server Class Reference

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

#include <Server.h>

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.

Private Attributes

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

Detailed Description

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

Author
jwienke

Definition at line 53 of file Server.h.

Member Typedef Documentation

Definition at line 228 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

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(), informerConfig, listenerConfig, methods, requestListeners, 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 247 of file Server.h.

Referenced by registerMethod().

ParticipantConfig rsb::patterns::Server::listenerConfig
private

Definition at line 246 of file Server.h.

Referenced by registerMethod().

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

Definition at line 251 of file Server.h.

Referenced by registerMethod().

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

Definition at line 249 of file Server.h.

Referenced by registerMethod().

Scope rsb::patterns::Server::scope
private

Definition at line 245 of file Server.h.

Referenced by registerMethod().


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