From: Mikko Rasa Date: Mon, 23 Sep 2019 11:44:57 +0000 (+0300) Subject: Support serializing bool fields in Protocol X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a84075639100079175b0d99187b34f3ce319f9a7;p=libs%2Fnet.git Support serializing bool fields in Protocol --- 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 { };