2015-09-24 21:12:59 +02:00
|
|
|
#ifndef CLIENTMESSAGE_H
|
|
|
|
#define CLIENTMESSAGE_H
|
|
|
|
|
|
|
|
#include <string>
|
2015-10-01 22:09:55 +02:00
|
|
|
#include <json/json.h>
|
2015-09-24 21:12:59 +02:00
|
|
|
|
|
|
|
#include "doormessage.h"
|
|
|
|
|
|
|
|
class Clientmessage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Clientmessage(std::string token,
|
2015-10-05 23:30:25 +02:00
|
|
|
bool isOpen,
|
2015-09-24 21:12:59 +02:00
|
|
|
Doormessage doormessage);
|
2015-10-07 15:54:28 +02:00
|
|
|
Clientmessage();
|
|
|
|
|
|
|
|
Clientmessage &operator=(const Clientmessage& rhs);
|
2015-09-24 21:12:59 +02:00
|
|
|
|
2015-10-01 22:09:55 +02:00
|
|
|
static Clientmessage fromJson(const Json::Value &root);
|
|
|
|
static Clientmessage fromString(const std::string &json);
|
2015-09-24 21:12:59 +02:00
|
|
|
std::string toJson() const;
|
|
|
|
|
2015-09-25 00:38:34 +02:00
|
|
|
const std::string& token() const;
|
2015-10-05 23:30:25 +02:00
|
|
|
bool isOpen() const;
|
2015-09-25 00:38:34 +02:00
|
|
|
const Doormessage& doormessage() const;
|
|
|
|
|
2015-09-24 21:12:59 +02:00
|
|
|
private:
|
|
|
|
|
2015-10-07 15:54:28 +02:00
|
|
|
std::string _token;
|
|
|
|
bool _isOpen;
|
|
|
|
Doormessage _doormessage;
|
2015-09-25 00:38:34 +02:00
|
|
|
|
2015-10-07 15:54:28 +02:00
|
|
|
const static std::string _tokenKey;
|
2015-09-25 00:38:34 +02:00
|
|
|
const static std::string _unlockButtonKey;
|
|
|
|
const static std::string _lockButtonKey;
|
|
|
|
const static std::string _emergencyUnlockKey;
|
2015-09-25 03:26:07 +02:00
|
|
|
const static std::string _isOpenKey;
|
2015-09-24 21:12:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|