24template <
class CLIENT,
class REQUEST>
75 void handleRequest(CLIENT* client,
const string& command, REQUEST& request,
const uint32_t messageId,
const uint8_t retries) {
81 defaultHandler->handleRequest(client, request, messageId, retries);
Network server client request handler hub exception.
Network server client request handler hub.
ServerClientRequestHandler< CLIENT, REQUEST > * defaultHandler
void addHandler(ServerClientRequestHandler< CLIENT, REQUEST > *handler)
Adds a client request handler.
virtual ~ServerClientRequestHandlerHub()
Public destructor.
void handleRequest(CLIENT *client, const string &command, REQUEST &request, const uint32_t messageId, const uint8_t retries)
Handles a client request.
void setDefaultHandler(ServerClientRequestHandler< CLIENT, REQUEST > *handler)
Sets the client request default handler, will be used if command not found in request handler map.
RequestHandlerMap requestHandlerMap
ServerClientRequestHandlerHub()
Public constructor.
map< string, ServerClientRequestHandler< CLIENT, REQUEST > * > RequestHandlerMap
Network client request handler base class.
virtual void handleRequest(CLIENT *client, REQUEST &request, const uint32_t messageId, const uint8_t retries)=0
Request handler implementation.
const string & getCommand()
Returns this requests handler command name.