2 #include <samchon/API.hpp> 4 #include <samchon/protocol/Entity.hpp> 6 #include <samchon/library/Date.hpp> 7 #include <samchon/protocol/Invoke.hpp> 37 std::string listener_;
60 uid_ = invoke->get(
"_History_uid")->getValue<
size_t>();
61 listener_ = invoke->getListener();
63 start_time_ = std::chrono::system_clock::now();
68 virtual void construct(std::shared_ptr<library::XML> xml)
override 71 uid_ = xml->getProperty<
size_t>(
"uid");
72 listener_ = xml->getProperty(
"listener");
78 start_time_ = std::chrono::system_clock::from_time_t(0);
79 end_time_ = std::chrono::system_clock::from_time_t(0);
82 start_time_ += std::chrono::duration<long long, std::ratio_multiply<std::ratio<100i64, 1i64>, std::nano>>(xml->getProperty<
long long>(
"startTime"));
83 end_time_ += std::chrono::duration<long long, std::ratio_multiply<std::ratio<100i64, 1i64>, std::nano>>(xml->getProperty<
long long>(
"endTime"));
89 virtual auto key() const ->
size_t override 135 return (end_time_ - start_time_).count();
145 end_time_ = std::chrono::system_clock::now();
151 virtual auto TAG()
const -> std::string
156 virtual auto toXML()
const -> std::shared_ptr<library::XML>
override 158 std::shared_ptr<library::XML> &xml = super::toXML();
159 xml->setProperty(
"uid", uid_);
160 xml->setProperty(
"listener", listener_);
162 xml->setProperty(
"startTime", start_time_.time_since_epoch().count());
163 xml->setProperty(
"endTime", end_time_.time_since_epoch().count());
168 auto toInvoke()
const -> std::shared_ptr<protocol::Invoke>
170 return std::make_shared<protocol::Invoke>(
"_Report_history", toXML());
An entity, a standard data class.
InvokeHistory(std::shared_ptr< protocol::Invoke > invoke)
auto getUID() const -> size_t
auto computeElapsedTime() const -> long long
virtual auto key() const -> size_t override
Get a key that can identify the Entity uniquely.
auto getListener() const -> std::string
Date (year, month, day in month)