Serializer for primitive builtin types. More...
#include <PrimitiveSerializer.h>
Public Member Functions | |
virtual uint32_t | CalculateSerializedLength (const swarmio::data::Variant &value, const FieldStack &fieldStack) const override |
Calculate the length of a serialized message in bytes. More... | |
virtual swarmio::data::Variant | Deserialize (ros::serialization::IStream &stream, const FieldStack &fieldStack) const override |
Deserialize a stream into a variant. More... | |
virtual swarmio::data::Variant | DeserializeArray (ros::serialization::IStream &stream, uint32_t count, const FieldStack &fieldStack) const override |
Deserialize a stream into a variant array. More... | |
virtual void | EmitDefault (ros::serialization::OStream &stream, const FieldStack &fieldStack) const override |
Write the default value to the stream. More... | |
virtual uint32_t | GetDefaultLength (const FieldStack &fieldStack) const override |
Get the length of the default value. More... | |
virtual swarmio::data::discovery::Field | GetFieldDescriptor () const override |
Build a field descriptor for the underlying type. More... | |
PrimitiveType | GetType () const |
Get underlying data type. More... | |
PrimitiveSerializer (const std::string &name, PrimitiveType type) | |
Construct a new PrimitiveSerializer object. More... | |
virtual void | Serialize (ros::serialization::OStream &stream, const swarmio::data::Variant &value, const FieldStack &fieldStack) const override |
Serialize a variant onto a stream. More... | |
Public Member Functions inherited from swarmros::introspection::Serializer | |
virtual const std::string & | GetFullName () const |
Get the fully qualified name for the type behind the serializer. More... | |
const std::string & | GetName () const |
Get the non-qualified name for the type behind the serializer. More... | |
virtual | ~Serializer () |
Destructor. More... | |
Private Attributes | |
PrimitiveType | _type |
Type. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from swarmros::introspection::Serializer | |
Serializer (const std::string &name) | |
Construct a new Serializer object. More... | |
Static Protected Member Functions inherited from swarmros::introspection::Serializer | |
static const Serializer & | SerializerForType (const std::string &type, const std::string &parentPackage) |
Look up or build a reader for a message type. More... | |
Serializer for primitive builtin types.
Definition at line 37 of file PrimitiveSerializer.h.
|
inline |
Construct a new PrimitiveSerializer object.
type | Type |
Definition at line 54 of file PrimitiveSerializer.h.
|
overridevirtual |
Calculate the length of a serialized message in bytes.
value | Value |
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 613 of file PrimitiveSerializer.cpp.
|
overridevirtual |
Deserialize a stream into a variant.
stream | Input stream |
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 378 of file PrimitiveSerializer.cpp.
|
overridevirtual |
Deserialize a stream into a variant array.
stream | Input stream |
count | Item count |
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 445 of file PrimitiveSerializer.cpp.
|
overridevirtual |
Write the default value to the stream.
stream | Output stream |
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 734 of file PrimitiveSerializer.cpp.
|
overridevirtual |
Get the length of the default value.
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 582 of file PrimitiveSerializer.cpp.
|
overridevirtual |
Build a field descriptor for the underlying type.
Implements swarmros::introspection::Serializer.
Definition at line 801 of file PrimitiveSerializer.cpp.
|
inline |
|
overridevirtual |
Serialize a variant onto a stream.
stream | Output stream |
value | Value to serialize |
fieldStack | Stack of fields to determine location |
Implements swarmros::introspection::Serializer.
Definition at line 258 of file PrimitiveSerializer.cpp.
|
private |
Type.
Definition at line 45 of file PrimitiveSerializer.h.