diff options
author | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-05-11 10:25:56 +0900 |
---|---|---|
committer | sangwan.kwon <sangwan.kwon@samsung.com> | 2016-05-11 14:35:31 +0900 |
commit | 93a4383419a348cb773f638776062648b5dc71d2 (patch) | |
tree | 7eb7977324f924d63cf27d052237949f797655de /src/common/serialization.h | |
parent | 6b884475b0cedb1bf67d438fd4bb01d1ac2e0680 (diff) | |
download | cert-checker-93a4383419a348cb773f638776062648b5dc71d2.tar.gz cert-checker-93a4383419a348cb773f638776062648b5dc71d2.tar.bz2 cert-checker-93a4383419a348cb773f638776062648b5dc71d2.zip |
Implement on-demand style about client-side
[AS-IS]
* cert-checker was daemon.
[TO-BE]
* Change to on-demand style.
* Add client library.
Change-Id: Ia318bc8a724db1f50a50bd42aa4c8c94b078e287
Diffstat (limited to 'src/common/serialization.h')
-rw-r--r-- | src/common/serialization.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/common/serialization.h b/src/common/serialization.h index 7f0ee84..04bd89d 100644 --- a/src/common/serialization.h +++ b/src/common/serialization.h @@ -32,6 +32,8 @@ #include <set> #include <memory> +#include "common/command-id.h" + namespace CCHECKER { namespace Common { @@ -147,6 +149,11 @@ struct Serialization { stream.write(sizeof(*value), value); } + static void Serialize(IStream &stream, const CommandId value) + { + Serialize(stream, static_cast<int>(value)); + } + // std::string template <typename T, typename R, typename A> static void Serialize(IStream &stream, const std::basic_string<T, R, A> &str) @@ -399,6 +406,14 @@ struct Deserialization { { stream.read(sizeof(value), &value); } + + static void Deserialize(IStream &stream, CommandId &value) + { + int val; + Deserialize(stream, val); + value = static_cast<CommandId>(val); + } + static void Deserialize(IStream &stream, bool *&value) { value = new bool; |