#ifndef INCLUDE_DI_RPC_CLASS_NOTIFY_H_ #define INCLUDE_DI_RPC_CLASS_NOTIFY_H_ #include #include #include #include namespace Di { namespace Rpc { class Notify : public Msg { public: enum Type { NOTIFY_TYPE_UNKNOWN, NOTIFY_TYPE_STRING, NOTIFY_TYPE_NUMBER, NOTIFY_TYPE_DOUBLE, NOTIFY_TYPE_BOOL, NOTIFY_TYPE_OBJECT }; struct notifyInfo { unsigned int id; std::string label; std::string type; }; struct notifyData { unsigned int id; uint64_t time; Type type; std::shared_ptr value; }; std::vector notifyInfoList; std::vector notifyDataList; explicit Notify(std::shared_ptr msg); static std::string getStringValue(const struct notifyData &message); static int64_t getNumberValue(const struct notifyData &message); static double getDoubleValue(const struct notifyData &message); static bool getBoolValue(const struct notifyData &message); static std::shared_ptr getObjectValue(const struct notifyData &message); private: void __decodePublish(std::shared_ptr message); void __decodeMethodInfo(std::shared_ptr message); }; } // namespace Rpc } // namespace Di #endif // INCLUDE_DI_RPC_CLASS_NOTIFY_H_