From a84075639100079175b0d99187b34f3ce319f9a7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 23 Sep 2019 14:44:57 +0300 Subject: [PATCH] Support serializing bool fields in Protocol --- source/net/protocol.cpp | 2 ++ source/net/protocol.h | 1 + 2 files changed, 3 insertions(+) diff --git a/source/net/protocol.cpp b/source/net/protocol.cpp index 52678af..a152c55 100644 --- a/source/net/protocol.cpp +++ b/source/net/protocol.cpp @@ -106,6 +106,7 @@ const char *Protocol::BasicSerializer::deserialize(T &value, const char *buf, return buf; } +template char *Protocol::BasicSerializer::serialize(const bool &, char *, char *) const; template char *Protocol::BasicSerializer::serialize(const Int8 &, char *, char *) const; template char *Protocol::BasicSerializer::serialize(const Int16 &, char *, char *) const; template char *Protocol::BasicSerializer::serialize(const Int32 &, char *, char *) const; @@ -116,6 +117,7 @@ template char *Protocol::BasicSerializer::serialize(const UInt32 &, char template char *Protocol::BasicSerializer::serialize(const UInt64 &, char *, char *) const; template char *Protocol::BasicSerializer::serialize(const float &, char *, char *) const; template char *Protocol::BasicSerializer::serialize(const double &, char *, char *) const; +template const char *Protocol::BasicSerializer::deserialize(bool &, const char *, const char *) const; template const char *Protocol::BasicSerializer::deserialize(Int8 &, const char *, const char *) const; template const char *Protocol::BasicSerializer::deserialize(Int16 &, const char *, const char *) const; template const char *Protocol::BasicSerializer::deserialize(Int32 &, const char *, const char *) const; diff --git a/source/net/protocol.h b/source/net/protocol.h index 256d978..7beccfb 100644 --- a/source/net/protocol.h +++ b/source/net/protocol.h @@ -328,6 +328,7 @@ struct Protocol::Traits typedef CompoundSerializer Serializer; }; +template<> struct Protocol::Traits: BasicTraits { }; template<> struct Protocol::Traits: BasicTraits { }; template<> struct Protocol::Traits: BasicTraits { }; template<> struct Protocol::Traits: BasicTraits { }; -- 2.45.2