RSB
0.16.1
|
The server side of a request-reply-based communication channel. More...
#include <LocalServer.h>
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 | EventCallback |
Callback class with receives and returns events. More... | |
class | FunctionCallback |
An adapter to use boost functions for callbacks. More... | |
class | FunctionCallback< RequestType, void > |
An adapter to use boost functions without out return values as calblacks. More... | |
class | FunctionCallback< void, ReplyType > |
An adapter to use boost functions without a call argument for callbacks. More... | |
class | IntlCallback |
Callback object interface to implement for registering callable methods. More... | |
class | LocalMethod |
A derived Method class which can be called from the remote side and implements its behavior by invoking a client-supplied callback. More... | |
Public Types | |
typedef boost::shared_ptr< IntlCallback > | CallbackPtr |
typedef boost::shared_ptr< LocalMethod > | LocalMethodPtr |
typedef boost::function< void(void)> | FunctionType |
Type of functions that can be accepted. More... | |
Public Member Functions | |
LocalServer (const Scope &scope, const ParticipantConfig &listenerConfig, const ParticipantConfig &informerConfig) | |
virtual | ~LocalServer () |
virtual std::string | getKind () const |
Return the kind of the participant. More... | |
virtual const std::set< std::string > | getTransportURLs () const |
TODO. More... | |
void | registerMethod (const std::string &name, 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... | |
FunctionCallback (FunctionType function, const std::string &requestType=rsc::runtime::typeName(typeid(void)), const std::string &replyType=rsc::runtime::typeName(typeid(void))) | |
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... | |
Private Member Functions | |
EventPtr | intlCall (const std::string &methodName, EventPtr) |
EventPtr | intlCall (const std::string &, EventPtr) |
Private Attributes | |
ParticipantConfig | listenerConfig |
ParticipantConfig | informerConfig |
std::map< std::string, LocalMethodPtr > | methods |
FunctionType | function |
Additional Inherited Members | |
Protected Member Functions inherited from rsb::Participant | |
Participant (const Scope &scope, const ParticipantConfig &config) | |
The server side of a request-reply-based communication channel.
An adapter to use boost functions without a call argument and without return values for callbacks.
A callback which does not take a request and does not produce a result.
Definition at line 54 of file LocalServer.h.
typedef boost::shared_ptr<IntlCallback> rsb::patterns::LocalServer<>::CallbackPtr |
Definition at line 71 of file LocalServer.h.
typedef boost::function<void(void)> rsb::patterns::LocalServer<>::FunctionType |
Type of functions that can be accepted.
Definition at line 467 of file LocalServer.h.
typedef boost::shared_ptr<LocalMethod> rsb::patterns::LocalServer<>::LocalMethodPtr |
Definition at line 387 of file LocalServer.h.
rsb::patterns::LocalServer<>::LocalServer | ( | const Scope & | scope, |
const ParticipantConfig & | listenerConfig, | ||
const ParticipantConfig & | informerConfig | ||
) |
Definition at line 129 of file LocalServer.cpp.
|
virtual |
Definition at line 137 of file LocalServer.cpp.
References rsb::patterns::LocalServer<>::methods.
|
pure virtual |
Implement this method to perform actions.
methodName | called method |
std::exception | all exceptions based on this type are automatically caught and delivered to the remote server |
Referenced by rsb::patterns::LocalServer<>::EventCallback::intlCall().
|
inline |
Definition at line 430 of file LocalServer.h.
|
inlineexplicit |
Definition at line 469 of file LocalServer.h.
|
virtual |
Return the kind of the participant.
Examples include "informer"
, "listener"
and "reader"
.
Implements rsb::Participant.
Definition at line 144 of file LocalServer.cpp.
|
virtual |
|
inlineprivate |
Definition at line 445 of file LocalServer.h.
|
inlineprivate |
Definition at line 478 of file LocalServer.h.
void rsb::patterns::LocalServer<>::registerMethod | ( | const std::string & | name, |
CallbackPtr | callback | ||
) |
Register a new method with the given name.
name | Name of the new method. Has to be a legal scope component string. |
callback | callback to execute for the method |
MethodExistsException | thrown if a method with this name already exists |
Definition at line 152 of file LocalServer.cpp.
References rsb::Factory::createLocalMethod(), rsb::getFactory(), rsb::Participant::getScope(), rsb::patterns::LocalServer<>::informerConfig, rsb::patterns::LocalServer<>::listenerConfig, and rsb::patterns::LocalServer<>::methods.
|
private |
Definition at line 486 of file LocalServer.h.
|
private |
Definition at line 411 of file LocalServer.h.
Referenced by rsb::patterns::LocalServer<>::registerMethod().
|
private |
Definition at line 410 of file LocalServer.h.
Referenced by rsb::patterns::LocalServer<>::registerMethod().
|
private |
Definition at line 413 of file LocalServer.h.
Referenced by rsb::patterns::LocalServer<>::registerMethod(), and rsb::patterns::LocalServer<>::~LocalServer().