BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
GWResponse.h
1 #pragma once
2 
3 #include <Poco/SharedPtr.h>
4 #include <Poco/JSON/Object.h>
5 
6 #include "gwmessage/GWMessage.h"
7 
8 namespace BeeeOn {
9 
10 class GWAck;
11 
55 class GWResponse : public GWMessage {
56 public:
57  typedef Poco::SharedPtr<GWResponse> Ptr;
58 
59  enum Status {
77  };
78 
79  GWResponse();
80  GWResponse(const Poco::JSON::Object::Ptr object);
81 
82 protected:
83  GWResponse(const GWMessageTypeEnum::Raw &type);
84 
85 public:
86  void setStatus(Status status);
87  Status status() const;
88 
92  static Status convertStatus(const int value);
93 
94  void setAckExpected(bool expected);
95  bool ackExpected() const;
96 
100  Poco::SharedPtr<GWAck> ack() const;
101 };
102 
103 }
The GWMessage is abstract class representing messages (including their contents), that are being sent...
Definition: GWMessage.h:21
GWMessageType type() const
Returns the type of the message.
Definition: GWMessage.cpp:55
Status
Definition: GWResponse.h:59
Definition: GWResponse.h:71
static Status convertStatus(const int value)
Covert integer value to GWResponse::Status and return it.
Definition: GWResponse.cpp:59
Definition: GWResponse.h:67
Poco::SharedPtr< GWAck > ack() const
Creates and returns a corresponding GWAck message.
Definition: GWResponse.cpp:85
Definition: GWResponse.h:76
Represents a response to a request message (subclass of a GWRequest). The GWResponse can be used alon...
Definition: GWResponse.h:55
Definition: GWResponse.h:63