Abstract class for a session supporting JSON communication with command handling, inherits from JSONSession.
More...
#include <WebServer.h>
|
void | receiveJSON (picojson::value &val) |
| Receive a command from the web server. More...
|
|
virtual void | receiveCommand (const std::string &cmd, const JsonObject &data, JsonObject &returnValue)=0 |
| Handles specific commands from the web server. More...
|
|
virtual void | sendJSON (picojson::value &val) |
| Sends a JSON message to the client. More...
|
|
void | receiveMessage (const std::string &msg) |
| Receives a message from the client and parses it as JSON. More...
|
|
| Session () |
| Constructor for Session.
|
|
virtual | ~Session () |
| Destructor.
|
|
virtual int | getId () const |
| Returns the ID of the session.
|
|
virtual void | sendMessage (const std::string &msg) |
| Sends a message to the client. More...
|
|
virtual void | update () |
| Performs any necessary updates for the session.
|
|
virtual void | onWrite () |
| Function called when the session is ready to write.
|
|
Abstract class for a session supporting JSON communication with command handling, inherits from JSONSession.
◆ receiveCommand()
virtual void JsonSession::receiveCommand |
( |
const std::string & |
cmd, |
|
|
const JsonObject & |
data, |
|
|
JsonObject & |
returnValue |
|
) |
| |
|
pure virtual |
Handles specific commands from the web server.
- Parameters
-
cmd | command |
data | data (JSON) |
returnValue | return value (JSON) which will be sent back to the server |
◆ receiveJSON()
void JsonSession::receiveJSON |
( |
picojson::value & |
val | ) |
|
|
inlinevirtual |
Receive a command from the web server.
- Parameters
-
val | the command (in JSON format) |
Reimplemented from JSONSession.
The documentation for this class was generated from the following file:
- /home/spring-2025/drone_simulation/service/include/simulationmodel/WebServer.h