11 #ifndef RPCSERVER_AGGREGATOR_H
12 #define RPCSERVER_AGGREGATOR_H
45 template <
class T,
typename Tcallback>
46 struct registerConfigureCallback_f :
public std::function<void(T)> {
47 registerConfigureCallback_f(
const std::string& _id,
const Tcallback _callback)
48 : id(_id), callback(_callback)
53 void operator()(T& x) { x->i()->registerConfigureCallback(
id, callback); }
55 const Tcallback callback;
58 template <
class T,
typename Tcallback>
59 struct unregisterConfigureCallback_f :
public std::function<void(T)> {
60 unregisterConfigureCallback_f(
const std::string& _id) : id(_id) { ; }
62 void operator()(T& x) { x->i()->unregisterConfigureCallback(
id); }
66 template <
class T,
typename Tcallback>
67 struct registerQueryCallback_f :
public std::function<void(T)> {
68 registerQueryCallback_f(
const std::string& _id,
const Tcallback _callback)
69 : id(_id), callback(_callback)
74 void operator()(T& x) { x->i()->registerQueryCallback(
id, callback); }
76 const Tcallback callback;
79 template <
class T,
typename Tcallback>
80 struct unregisterQueryCallback_f :
public std::function<void(T)> {
81 unregisterQueryCallback_f(
const std::string& _id) : id(_id) { ; }
83 void operator()(T& x) { x->i()->unregisterQueryCallback(
id); }
88 template <
class T,
typename Tcallback>
89 struct registerHandlerCallback_f :
public std::function<void(T)> {
90 registerHandlerCallback_f(
const std::string& _id,
const Tcallback _callback)
91 : id(_id), callback(_callback)
96 void operator()(T& x) { x->i()->registerHandlerCallback(
id, callback); }
98 const Tcallback callback;
101 template <
class T,
typename Tcallback>
102 struct unregisterHandlerCallback_f :
public std::function<void(T)> {
103 unregisterHandlerCallback_f(
const std::string& _id) : id(_id) { ; }
105 void operator()(T& x) { x->i()->unregisterHandlerCallback(
id); }
106 const std::string id;
110 const std::string d_type;
111 typedef std::vector<rpcmanager_base::rpcserver_booter_base_sptr> rpcServerMap_t;
112 std::vector<std::string> d_registeredServers;
113 rpcServerMap_t d_serverlist;
Definition: rpccallbackregister_base.h:83
Definition: rpcserver_aggregator.h:21
void registerQueryCallback(const std::string &id, const queryCallback_t callback) override
void registerHandlerCallback(const std::string &id, const handlerCallback_t callback) override
void unregisterConfigureCallback(const std::string &id) override
void registerServer(rpcmanager_base::rpcserver_booter_base_sptr server)
void unregisterQueryCallback(const std::string &id) override
void unregisterHandlerCallback(const std::string &id) override
~rpcserver_aggregator() override
void registerConfigureCallback(const std::string &id, const configureCallback_t callback) override
const std::vector< std::string > & registeredServers()
const std::string & type()
Definition: rpcserver_base.h:17