TDME2 1.9.121
Public Member Functions | Private Types | Private Attributes | List of all members
ServerClientRequestHandlerHub< CLIENT, REQUEST > Class Template Reference

Network server client request handler hub. More...

#include <tdme/network/udpserver/ServerClientRequestHandlerHub.h>

Collaboration diagram for ServerClientRequestHandlerHub< CLIENT, REQUEST >:
Collaboration graph

Public Member Functions

 ServerClientRequestHandlerHub ()
 Public constructor. More...
 
virtual ~ServerClientRequestHandlerHub ()
 Public destructor. More...
 
void addHandler (ServerClientRequestHandler< CLIENT, REQUEST > *handler)
 Adds a client request handler. More...
 
void setDefaultHandler (ServerClientRequestHandler< CLIENT, REQUEST > *handler)
 Sets the client request default handler, will be used if command not found in request handler map. More...
 
void handleRequest (CLIENT *client, const string &command, REQUEST &request, const uint32_t messageId, const uint8_t retries)
 Handles a client request. More...
 

Private Types

typedef map< string, ServerClientRequestHandler< CLIENT, REQUEST > * > RequestHandlerMap
 

Private Attributes

RequestHandlerMap requestHandlerMap
 
ServerClientRequestHandler< CLIENT, REQUEST > * defaultHandler
 

Detailed Description

template<class CLIENT, class REQUEST>
class tdme::network::udpserver::ServerClientRequestHandlerHub< CLIENT, REQUEST >

Network server client request handler hub.

Author
Andreas Drewke

Definition at line 25 of file ServerClientRequestHandlerHub.h.

Member Typedef Documentation

◆ RequestHandlerMap

typedef map<string, ServerClientRequestHandler<CLIENT,REQUEST>*> RequestHandlerMap
private

Definition at line 93 of file ServerClientRequestHandlerHub.h.

Constructor & Destructor Documentation

◆ ServerClientRequestHandlerHub()

Public constructor.

Definition at line 30 of file ServerClientRequestHandlerHub.h.

◆ ~ServerClientRequestHandlerHub()

virtual ~ServerClientRequestHandlerHub ( )
inlinevirtual

Public destructor.

Definition at line 36 of file ServerClientRequestHandlerHub.h.

Member Function Documentation

◆ addHandler()

void addHandler ( ServerClientRequestHandler< CLIENT, REQUEST > *  handler)
inline

Adds a client request handler.

Parameters
handlerrequest handler
Exceptions
TCPServerClientRequestHandlerHubException

Definition at line 50 of file ServerClientRequestHandlerHub.h.

◆ handleRequest()

void handleRequest ( CLIENT *  client,
const string &  command,
REQUEST &  request,
const uint32_t  messageId,
const uint8_t  retries 
)
inline

Handles a client request.

Parameters
clientclient
commandcommand
requestrequest
messageIdmessage id (udp server only)
retriesretries (udp server only)

Definition at line 75 of file ServerClientRequestHandlerHub.h.

◆ setDefaultHandler()

void setDefaultHandler ( ServerClientRequestHandler< CLIENT, REQUEST > *  handler)
inline

Sets the client request default handler, will be used if command not found in request handler map.

Parameters
handlerrequest handler

Definition at line 63 of file ServerClientRequestHandlerHub.h.

Member Data Documentation

◆ defaultHandler

ServerClientRequestHandler<CLIENT,REQUEST>* defaultHandler
private

Definition at line 95 of file ServerClientRequestHandlerHub.h.

◆ requestHandlerMap

RequestHandlerMap requestHandlerMap
private

Definition at line 94 of file ServerClientRequestHandlerHub.h.


The documentation for this class was generated from the following file: