diff options
m--------- | grextras | 0 | ||||
-rw-r--r-- | include/gras/tags.hpp | 1 | ||||
-rw-r--r-- | lib/serialize_types.cpp | 13 | ||||
-rw-r--r-- | lib/tags.cpp | 7 |
4 files changed, 21 insertions, 0 deletions
diff --git a/grextras b/grextras -Subproject ef9d5db728f1cc59f249e17eb35c1e52b27297d +Subproject 42f368250de4d819f0c417279e2b6ea9b68ecad diff --git a/include/gras/tags.hpp b/include/gras/tags.hpp index e3c8982..8214d4e 100644 --- a/include/gras/tags.hpp +++ b/include/gras/tags.hpp @@ -40,6 +40,7 @@ struct GRAS_API Tag : boost::less_than_comparable<Tag> }; GRAS_API bool operator<(const Tag &lhs, const Tag &rhs); +GRAS_API bool operator==(const Tag &lhs, const Tag &rhs); /*! * A stream tag is a commonly used structure diff --git a/lib/serialize_types.cpp b/lib/serialize_types.cpp index fde7277..ae4df65 100644 --- a/lib/serialize_types.cpp +++ b/lib/serialize_types.cpp @@ -54,6 +54,19 @@ void load(Archive & ar, gras::SBuffer & b, unsigned int version) BOOST_SERIALIZATION_SPLIT_FREE(gras::SBuffer) PMC_SERIALIZE_EXPORT(gras::SBuffer, "PMC<gras::SBuffer>") +/*********************************************************************** + * support for tag type + **********************************************************************/ +namespace boost { namespace serialization { +template <class Archive> +void serialize(Archive &ar, gras::Tag &t, const unsigned int) +{ + ar & t.offset; + ar & t.object; +} +}} + +PMC_SERIALIZE_EXPORT(gras::Tag, "PMC<gras::Tag>") /*********************************************************************** * support for special packet msg type diff --git a/lib/tags.cpp b/lib/tags.cpp index 0b510f6..d9f1dab 100644 --- a/lib/tags.cpp +++ b/lib/tags.cpp @@ -15,6 +15,13 @@ bool gras::operator<(const Tag &lhs, const Tag &rhs) return lhs.offset < rhs.offset; } +bool gras::operator==(const Tag &lhs, const Tag &rhs) +{ + return + lhs.offset == rhs.offset and + lhs.object.eq(rhs.object); +} + StreamTag::StreamTag(const PMCC &key, const PMCC &val, const PMCC &src): key(key), val(val), src(src) { |