#include <api_handler.h>
|
typedef std::function< HANDLER_RESULT< ApiResponse >(ApiRequest &)> | REQUEST_HANDLER |
| A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.
|
|
|
template<class RequestType, class ResponseType, class HandlerType> |
void | registerHandler (HANDLER_RESULT< ResponseType >(HandlerType::*aHandler)(const HANDLER_CONTEXT< RequestType > &)) |
| Registers an API command handler for the given message types.
|
|
|
template<typename MessageType> |
bool | tryUnpack (ApiRequest &aRequest, ApiResponse &aReply, MessageType &aDest) |
|
Definition at line 56 of file api_handler.h.
◆ REQUEST_HANDLER
A handler for outer messages (envelopes) that will unpack to inner messages and call a specific handler function.
- See also
- registerHandler.
Definition at line 76 of file api_handler.h.
◆ API_HANDLER()
API_HANDLER::API_HANDLER |
( |
| ) |
|
|
inline |
◆ ~API_HANDLER()
virtual API_HANDLER::~API_HANDLER |
( |
| ) |
|
|
inlinevirtual |
◆ Handle()
API_RESULT API_HANDLER::Handle |
( |
ApiRequest & | aMsg | ) |
|
Attempt to handle the given API request, if a handler exists in this class for the message.
- Parameters
-
aMsg | is a request to attempt to handle |
- Returns
- a response to send to the client, or an appropriate error
Definition at line 30 of file api_handler.cpp.
References m_handlers.
◆ registerHandler()
template<class RequestType, class ResponseType, class HandlerType>
◆ tryUnpack()
template<typename MessageType>
bool API_HANDLER::tryUnpack |
( |
ApiRequest & | aRequest, |
|
|
ApiResponse & | aReply, |
|
|
MessageType & | aDest ) |
|
inlineprivate |
◆ m_defaultCommitMessage
const wxString API_HANDLER::m_defaultCommitMessage = _( "Modification from API" ) |
|
staticprotected |
◆ m_handlers
The documentation for this class was generated from the following files: