#include <RocServer.h>
|
| RocServer (zmq::context_t &_ctx, const std::string &_brokerEndpoint, const std::string &_serviceName) |
|
virtual | ~RocServer () |
|
|
virtual void | startup () |
| called in handler thread on startup More...
|
|
virtual void | teardown () |
| called in handler thread on shutdown More...
|
|
virtual void | onRequest (std::list< zmq::message_t * > *envelope, std::list< zmq::message_t * > *data) |
| The (not anymore) "to-be-overloaded" request handler. More...
|
|
virtual Json::Value | call (const std::string &name, const Json::Value &arguments) |
| The "to-be-overloaded" call handler. More...
|
|
virtual Json::Value | getattr (const std::string &name) |
| The "to-be-overloaded" getattr handler. More...
|
|
virtual void | setattr (const std::string &name, const Json::Value &value) |
| The "to-be-overloaded" setattr handler. More...
|
|
void | reply (std::list< zmq::message_t * > *envelope, std::list< zmq::message_t * > *data=nullptr) |
|
void | replyValue (std::list< zmq::message_t * > *envelope, const Json::Value &value, const std::string &id="") |
|
void | replyError (std::list< zmq::message_t * > *envelope, int errorNo, const std::string &id="") |
|
Definition at line 24 of file RocServer.h.
RocServer::RocServer |
( |
zmq::context_t & |
_ctx, |
|
|
const std::string & |
_brokerEndpoint, |
|
|
const std::string & |
_serviceName |
|
) |
| |
RocServer::~RocServer |
( |
| ) |
|
|
virtual |
Json::Value RocServer::call |
( |
const std::string & |
name, |
|
|
const Json::Value & |
arguments |
|
) |
| |
|
protectedvirtual |
The "to-be-overloaded" call handler.
This function is called by incoming request. Arguments must be passed as JSON. If the function is not implemented, RocNotImplementedError must be thrown.
- Parameters
-
name | function name |
arguments | JSON encoded call arguments |
- Returns
- JSON encoded return value
Definition at line 49 of file RocServer.cpp.
Json::Value RocServer::getattr |
( |
const std::string & |
name | ) |
|
|
protectedvirtual |
The "to-be-overloaded" getattr handler.
This function is called by incoming request. If the attribute is not implemented, RocNotImplementedError must be thrown. If it is callable, RocIsCallable must be thrown.
- Parameters
-
- Returns
- JSON encoded return value
Definition at line 55 of file RocServer.cpp.
void RocServer::onRequest |
( |
std::list< zmq::message_t * > * |
envelope, |
|
|
std::list< zmq::message_t * > * |
data |
|
) |
| |
|
protectedvirtual |
The (not anymore) "to-be-overloaded" request handler.
- Note
- This function must delete data and all contained messages.
-
This function must call reply(...) with the passed envelope.
Definition at line 87 of file RocServer.cpp.
void RocServer::reply |
( |
std::list< zmq::message_t * > * |
envelope, |
|
|
std::list< zmq::message_t * > * |
data = nullptr |
|
) |
| |
|
protected |
void RocServer::replyError |
( |
std::list< zmq::message_t * > * |
envelope, |
|
|
int |
errorNo, |
|
|
const std::string & |
id = "" |
|
) |
| |
|
protected |
void RocServer::replyValue |
( |
std::list< zmq::message_t * > * |
envelope, |
|
|
const Json::Value & |
value, |
|
|
const std::string & |
id = "" |
|
) |
| |
|
protected |
void RocServer::setattr |
( |
const std::string & |
name, |
|
|
const Json::Value & |
value |
|
) |
| |
|
protectedvirtual |
The "to-be-overloaded" setattr handler.
This function is called by incoming request. If the attribute is not implemented, RocNotImplementedError must be thrown. If it is callable, RocIsCallable must be thrown.
- Parameters
-
name | attribute name |
value | JSON encoded value |
Definition at line 60 of file RocServer.cpp.
void RocServer::startup |
( |
| ) |
|
|
protectedvirtual |
called in handler thread on startup
Definition at line 41 of file RocServer.cpp.
void RocServer::teardown |
( |
| ) |
|
|
protectedvirtual |
called in handler thread on shutdown
Definition at line 45 of file RocServer.cpp.
zmq::context_t& RocServer::ctx |
|
protected |
The documentation for this class was generated from the following files: