14 #ifndef JSON_SERIALIZABLE_HPP
15 #define JSON_SERIALIZABLE_HPP
17 #include <Poco/Dynamic/Var.h>
25 template <
class T =
unsigned long long>
32 result = static_cast<T>(std::stoull(var.convert<std::string>()));
40 result = static_cast<T>(var.convert<Poco::Int64>());
42 result =
static_cast<T
>(var.convert<Poco::UInt64>());
45 result =
static_cast<T
>(var.convert<
double>());
51 result = defaultValue;
59 virtual bool serialize(std::string& json)=0;
60 virtual bool unserialize(
const std::string& json)=0;
78 #endif // JSON_SERIALIZABLE_HPP