4 #include <swarmio/data/Variant.pb.h> 31 void WriteTypeName(std::stringstream& stream,
bool forHash)
const;
42 :
Serializer(name), _serializer(serializer) { }
51 virtual void WriteDefinition(std::stringstream& stream,
bool forHash)
const;
virtual void Serialize(ros::serialization::OStream &stream, const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
Serialize a variant onto a stream.
const Serializer & GetSerializer() const
Get the associated serializer.
virtual swarmio::data::discovery::Field GetFieldDescriptor() const override
Build a field descriptor for the underlying type.
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const override
Get the length of the default value.
A Field represents an entry in a message reader that can read one of its fields.
virtual void WriteDefinition(std::stringstream &stream, bool forHash) const
Write the definition of this field to a string stream.
void WriteTypeName(std::stringstream &stream, bool forHash) const
Get the type name for the serializer.
const Serializer & _serializer
Serializer.
virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
Calculate the length of a serialized message in bytes.
Serializer is the base class for all binary message interpreters.
Field(const std::string &name, const Serializer &serializer)
Construct a new Field object.
virtual swarmio::data::Variant Deserialize(ros::serialization::IStream &stream, const FieldStack &fieldStack) const override
Deserialize a stream into a variant.
virtual swarmio::data::Variant DeserializeArray(ros::serialization::IStream &stream, uint32_t count, const FieldStack &fieldStack) const override
Deserialize a stream into a variant array - not supported on Fields.
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const override
Write the default value to the stream.