diff options
Diffstat (limited to 'modules/codec')
-rw-r--r-- | modules/codec/c++/data.hpp | 18 | ||||
-rw-r--r-- | modules/codec/c++/schema_stringify.hpp | 6 |
2 files changed, 17 insertions, 7 deletions
diff --git a/modules/codec/c++/data.hpp b/modules/codec/c++/data.hpp index ca976d5..2196408 100644 --- a/modules/codec/c++/data.hpp +++ b/modules/codec/c++/data.hpp @@ -430,21 +430,31 @@ public: typename native_data_type<schema::Primitive<T,N>>::type get() const {return value_;} - data<schema::Primitive<T,N>, encode::Native> operator*(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator*(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() * rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator/(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator/(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() / rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator+(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator+(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() + rhs.get()}; } - data<schema::Primitive<T,N>, encode::Native> operator-(const saw::data<schema::Primitive<T,N>, encode::Native>& rhs)const{ + data<schema::Primitive<T,N>, encode::Native> operator-(const data<schema::Primitive<T,N>, encode::Native>& rhs)const{ return {get() - rhs.get()}; } + + template<typename Enc> + bool operator==(const data<schema::Primitive<T,N>, Enc>& rhs)const{ + return get() == rhs.get(); + } + + template<typename Enc> + bool operator<(const data<schema::Primitive<T,N>, Enc>& rhs) const { + return get() < rhs.get(); + } }; diff --git a/modules/codec/c++/schema_stringify.hpp b/modules/codec/c++/schema_stringify.hpp index 05978e3..797823a 100644 --- a/modules/codec/c++/schema_stringify.hpp +++ b/modules/codec/c++/schema_stringify.hpp @@ -36,21 +36,21 @@ struct schema_stringify<schema::Primitive<T,N>> { template<> struct schema_stringify<schema::SignedInteger> { static void apply(std::stringstream& iss) { - iss << "saw:schema::SignedInteger"; + iss << "saw::schema::SignedInteger"; } }; template<> struct schema_stringify<schema::UnsignedInteger> { static void apply(std::stringstream& iss) { - iss << "saw:schema::UnsignedInteger"; + iss << "saw::schema::UnsignedInteger"; } }; template<> struct schema_stringify<schema::FloatingPoint> { static void apply(std::stringstream& iss) { - iss << "saw:schema::FloatingPoint"; + iss << "saw::schema::FloatingPoint"; } }; |