Public Member Functions | Private Attributes | List of all members
swarmros::introspection::PrimitiveSerializer Class Reference

Serializer for primitive builtin types. More...

#include <PrimitiveSerializer.h>

Inheritance diagram for swarmros::introspection::PrimitiveSerializer:
Inheritance graph
[legend]

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 SerializerSerializerForType (const std::string &type, const std::string &parentPackage)
 Look up or build a reader for a message type. More...
 

Detailed Description

Serializer for primitive builtin types.

Definition at line 37 of file PrimitiveSerializer.h.

Constructor & Destructor Documentation

swarmros::introspection::PrimitiveSerializer::PrimitiveSerializer ( const std::string &  name,
PrimitiveType  type 
)
inline

Construct a new PrimitiveSerializer object.

Parameters
typeType

Definition at line 54 of file PrimitiveSerializer.h.

Member Function Documentation

uint32_t PrimitiveSerializer::CalculateSerializedLength ( const swarmio::data::Variant &  value,
const FieldStack fieldStack 
) const
overridevirtual

Calculate the length of a serialized message in bytes.

Parameters
valueValue
fieldStackStack of fields to determine location
Returns
uint32_t

Implements swarmros::introspection::Serializer.

Definition at line 613 of file PrimitiveSerializer.cpp.

swarmio::data::Variant PrimitiveSerializer::Deserialize ( ros::serialization::IStream stream,
const FieldStack fieldStack 
) const
overridevirtual

Deserialize a stream into a variant.

Parameters
streamInput stream
fieldStackStack of fields to determine location
Returns
swarmio::data::Variant

Implements swarmros::introspection::Serializer.

Definition at line 378 of file PrimitiveSerializer.cpp.

swarmio::data::Variant PrimitiveSerializer::DeserializeArray ( ros::serialization::IStream stream,
uint32_t  count,
const FieldStack fieldStack 
) const
overridevirtual

Deserialize a stream into a variant array.

Parameters
streamInput stream
countItem count
fieldStackStack of fields to determine location
Returns
swarmio::data::Variant

Implements swarmros::introspection::Serializer.

Definition at line 445 of file PrimitiveSerializer.cpp.

void PrimitiveSerializer::EmitDefault ( ros::serialization::OStream stream,
const FieldStack fieldStack 
) const
overridevirtual

Write the default value to the stream.

Parameters
streamOutput stream
fieldStackStack of fields to determine location

Implements swarmros::introspection::Serializer.

Definition at line 734 of file PrimitiveSerializer.cpp.

uint32_t PrimitiveSerializer::GetDefaultLength ( const FieldStack fieldStack) const
overridevirtual

Get the length of the default value.

Parameters
fieldStackStack of fields to determine location
Returns
uint32_t

Implements swarmros::introspection::Serializer.

Definition at line 582 of file PrimitiveSerializer.cpp.

swarmio::data::discovery::Field PrimitiveSerializer::GetFieldDescriptor ( ) const
overridevirtual

Build a field descriptor for the underlying type.

Returns
swarmio::data::discovery::Field

Implements swarmros::introspection::Serializer.

Definition at line 801 of file PrimitiveSerializer.cpp.

PrimitiveType swarmros::introspection::PrimitiveSerializer::GetType ( ) const
inline

Get underlying data type.

Returns
PrimitiveType

Definition at line 62 of file PrimitiveSerializer.h.

void PrimitiveSerializer::Serialize ( ros::serialization::OStream stream,
const swarmio::data::Variant &  value,
const FieldStack fieldStack 
) const
overridevirtual

Serialize a variant onto a stream.

Parameters
streamOutput stream
valueValue to serialize
fieldStackStack of fields to determine location

Implements swarmros::introspection::Serializer.

Definition at line 258 of file PrimitiveSerializer.cpp.

Member Data Documentation

PrimitiveType swarmros::introspection::PrimitiveSerializer::_type
private

Type.

Definition at line 45 of file PrimitiveSerializer.h.


The documentation for this class was generated from the following files:


swarmros
Author(s):
autogenerated on Fri Apr 3 2020 03:42:48