4 #include <swarmio/data/Variant.pb.h> 5 #include <swarmio/data/discovery/Schema.pb.h> virtual swarmio::data::Variant Deserialize(ros::serialization::IStream &stream, const FieldStack &fieldStack) const =0
Deserialize a stream into a variant.
virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant &value, const FieldStack &fieldStack) const =0
Calculate the length of a serialized message in bytes.
virtual swarmio::data::Variant DeserializeArray(ros::serialization::IStream &stream, uint32_t count, const FieldStack &fieldStack) const =0
Deserialize a stream into a variant array.
virtual ~Serializer()
Destructor.
Serializer(const std::string &name)
Construct a new Serializer object.
virtual swarmio::data::discovery::Field GetFieldDescriptor() const =0
Build a field descriptor for the underlying type.
static std::map< std::string, std::unique_ptr< Serializer > > LoadDefaultSerializers()
Load the list of default serializers.
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const =0
Write the default value to the stream.
std::string _name
Non-qualified name for the type behind the serializer.
virtual const std::string & GetFullName() const
Get the fully qualified name for the type behind the serializer.
static std::map< std::string, std::unique_ptr< Serializer > > _defaultSerializers
List of built-in default serializers.
Serializer is the base class for all binary message interpreters.
const std::string & GetName() const
Get the non-qualified name for the type behind the serializer.
static const Serializer & SerializerForType(const std::string &type, const std::string &parentPackage)
Look up or build a reader for a message type.
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const =0
Get the length of the default value.
virtual void Serialize(ros::serialization::OStream &stream, const swarmio::data::Variant &value, const FieldStack &fieldStack) const =0
Serialize a variant onto a stream.