BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
BeeeOn::GWMessage Class Reference

The GWMessage is abstract class representing messages (including their contents), that are being sent between Gateway and Server. More...

#include <GWMessage.h>

Inheritance diagram for BeeeOn::GWMessage:
BeeeOn::GWAck BeeeOn::GWGatewayAccepted BeeeOn::GWGatewayRegister BeeeOn::GWRequest BeeeOn::GWResponse BeeeOn::GWSensorDataConfirm BeeeOn::GWSensorDataExport BeeeOn::GWDeviceAcceptRequest BeeeOn::GWDeviceListRequest BeeeOn::GWLastValueRequest BeeeOn::GWListenRequest BeeeOn::GWNewDeviceGroupRequest BeeeOn::GWNewDeviceRequest BeeeOn::GWNoticeRequest BeeeOn::GWSearchRequest BeeeOn::GWSetValueRequest BeeeOn::GWUnpairRequest BeeeOn::GWDeviceListResponse BeeeOn::GWLastValueResponse BeeeOn::GWResponseWithAck BeeeOn::GWUnpairResponse

Public Types

typedef Poco::SharedPtr
< GWMessage
Ptr
 

Public Member Functions

void setID (const GlobalID &id)
 Set unique identifier intended to match request message with its response.
 
GlobalID id () const
 Return unique identifier intended to match request message with its response.
 
GWMessageType type () const
 Returns the type of the message.
 
std::string toString () const
 Returns the string representation of the message.
 
std::string toBriefString () const
 

Static Public Member Functions

static GWMessage::Ptr fromJSON (const std::string &json)
 Factory method for creating subclasses of the GWMessage from the json string. More...
 
static GWMessage::Ptr fromJSON (Poco::JSON::Object::Ptr object)
 Factory method for creating subclasses of the GWMessage from the JSON::Object. More...
 

Protected Member Functions

 GWMessage (const GWMessageType::Raw &type)
 Constructs a GWMessage depending on the given type. More...
 
 GWMessage (const Poco::JSON::Object::Ptr object)
 Constructs a GWMessage from the JSON::Object.
 
Poco::JSON::Object::Ptr json () const
 

Detailed Description

The GWMessage is abstract class representing messages (including their contents), that are being sent between Gateway and Server.

The internal representation of the GWMessage is the Poco::JSON::Object. All subclasses should set the values directly into that instance via accessing method json(). This leads to a lazy-validation behaviour.

Constructor & Destructor Documentation

GWMessage::GWMessage ( const GWMessageType::Raw &  type)
protected

Constructs a GWMessage depending on the given type.

The type is set to the internal JSON::Object.

Member Function Documentation

GWMessage::Ptr GWMessage::fromJSON ( const std::string &  json)
static

Factory method for creating subclasses of the GWMessage from the json string.

Type of the created message is determined by the message type in the json string.

GWMessage::Ptr GWMessage::fromJSON ( Poco::JSON::Object::Ptr  object)
static

Factory method for creating subclasses of the GWMessage from the JSON::Object.

Type of the created message is determined by the message type in the JSON::Object.

string GWMessage::toBriefString ( ) const
Returns
brief representation of the message (useful for logging).

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