18 #ifndef ServiceRegistry_h__
19 #define ServiceRegistry_h__
50 template<
class Service>
56 template<
class Service>
59 Service(session).CallServerMethod(token, methodId, std::forward<MessageBuffer>(buffer));
62 std::unordered_map<uint32, std::function<void(Session*, uint32, uint32, MessageBuffer)>>
_dispatchers;
66 #define sServiceDispatcher ServiceDispatcher::Instance()
68 #endif // ServiceRegistry_h__
static void Dispatch(Session *session, uint32 token, uint32 methodId, MessageBuffer buffer)
Definition: ServiceDispatcher.h:57
void Dispatch(Session *session, uint32 serviceHash, uint32 token, uint32 methodId, MessageBuffer buffer)
Definition: ServiceDispatcher.cpp:35
Definition: method_options.pb.h:28
std::unordered_map< uint32, std::function< void(Session *, uint32, uint32, MessageBuffer)> > _dispatchers
Definition: ServiceDispatcher.h:62
static ServiceDispatcher & Instance()
Definition: ServiceDispatcher.cpp:44
Definition: ServiceDispatcher.h:40
ServiceDispatcher()
Definition: ServiceDispatcher.cpp:20
uint32_t uint32
Definition: Define.h:150
void AddService()
Definition: ServiceDispatcher.h:51
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: MessageBuffer.h:24