![]() |
BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
The GWMessage is abstract class representing messages (including their contents), that are being sent between Gateway and Server. More...
#include <GWMessage.h>
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 |
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.
|
protected |
Constructs a GWMessage depending on the given type.
The type is set to the internal JSON::Object.
|
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.
|
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 |
1.8.5