summaryrefslogtreecommitdiff
path: root/src/common/serialization.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/serialization.h')
-rw-r--r--src/common/serialization.h15
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;