CSCI3081W Drone Delivery System
Public Member Functions | List of all members
JSONSession Class Reference

Abstract class for a session supporting JSON communication. More...

#include <WebServer.h>

Inheritance diagram for JSONSession:
Inheritance graph
[legend]
Collaboration diagram for JSONSession:
Collaboration graph
[legend]

Public Member Functions

virtual void receiveJSON (picojson::value &val)
 Receives a JSON message from the client. 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...
 
- Public Member Functions inherited from WebServerBase::Session
 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.
 

Detailed Description

Abstract class for a session supporting JSON communication.

Member Function Documentation

◆ receiveJSON()

virtual void JSONSession::receiveJSON ( picojson::value &  val)
inlinevirtual

Receives a JSON message from the client.

Parameters
valThe JSON value received from the client

Reimplemented in JsonSession.

◆ receiveMessage()

void JSONSession::receiveMessage ( const std::string &  msg)
inlinevirtual

Receives a message from the client and parses it as JSON.

Parameters
msgThe message received from the client

Reimplemented from WebServerBase::Session.

◆ sendJSON()

virtual void JSONSession::sendJSON ( picojson::value &  val)
inlinevirtual

Sends a JSON message to the client.

Parameters
valThe JSON value to send to the client

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