Definition at line 548 of file main.cpp.
◆ CommandDispatcher() [1/2]
CommandDispatcher::CommandDispatcher |
( |
| ) |
|
|
inline |
◆ ~CommandDispatcher()
virtual CommandDispatcher::~CommandDispatcher |
( |
| ) |
|
|
inlinevirtual |
◆ CommandDispatcher() [2/2]
◆ addCommandHandler()
bool CommandDispatcher::addCommandHandler |
( |
std::string |
command, |
|
|
CommandHandler |
handler |
|
) |
| |
|
inline |
adds a command and handler pair to the map
- Parameters
-
command | a string |
handler | a CommandHandler object containing a DOM value |
- Returns
- true if addition successful, false if not
add command and handler pair to map
check if command already added to map
Definition at line 585 of file main.cpp.
◆ dispatchCommand()
bool CommandDispatcher::dispatchCommand |
( |
std::string |
command_json | ) |
|
|
inline |
initial receiver of command
- Parameters
-
command_json | a raw string of JSON commands |
- Exceptions
-
exception | if JSON malformed |
exception | if JSON contains no member "command" |
exception | if JSON contains no member "payload" |
exception | if no match for command found in map |
- Returns
- true if command dispatched to handler
- Todo:
- change cout calls to shared print?
- Todo:
- maybe typcast instead?
Definition at line 623 of file main.cpp.
◆ operator=()
◆ command_handlers_
std::map<std::string, CommandHandler> CommandDispatcher::command_handlers_ |
|
private |
map of command handlers
Definition at line 730 of file main.cpp.
◆ CUR_SCOPE
◆ doc
rapidjson::Document CommandDispatcher::doc |
|
private |
◆ map_itr
std::map<std::string, CommandHandler>::iterator CommandDispatcher::map_itr |
|
private |
Initial value:
iterator for the map
Definition at line 732 of file main.cpp.
The documentation for this class was generated from the following file: