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

Field for constant values. More...

#include <ConstantField.h>

Inheritance diagram for swarmros::introspection::ConstantField:
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...
 
 ConstantField (const std::string &name, const Serializer &serializer, const std::string &value)
 Construct a new ConstantField object. More...
 
virtual swarmio::data::Variant Deserialize (ros::serialization::IStream &stream, const FieldStack &fieldStack) const override
 Deserialize a stream into a variant. 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 void Serialize (ros::serialization::OStream &stream, const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
 Serialize a variant onto a stream. More...
 
virtual void WriteDefinition (std::stringstream &stream, bool forHash) const override
 Write the definition of this field to a string stream. More...
 
- Public Member Functions inherited from swarmros::introspection::Field
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. More...
 
 Field (const std::string &name, const Serializer &serializer)
 Construct a new Field object. More...
 
virtual swarmio::data::discovery::Field GetFieldDescriptor () const override
 Build a field descriptor for the underlying type. More...
 
const SerializerGetSerializer () const
 Get the associated serializer. 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 Member Functions

void ParseBool (const std::string &value)
 Parse a boolean value. More...
 
void ParseFloat (const std::string &value)
 Parse a floating point value. More...
 
void ParseSigned (const std::string &value)
 Parse a signed integer value. More...
 
void ParseString (const std::string &value)
 Parse a string value. More...
 
void ParseUnsigned (const std::string &value)
 Parse an unsigned integer value. More...
 

Private Attributes

std::string _rawValue
 Raw string value. More...
 
swarmio::data::Variant _value
 Value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from swarmros::introspection::Field
void WriteTypeName (std::stringstream &stream, bool forHash) const
 Get the type name for the serializer. More...
 
- 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...
 
- Protected Attributes inherited from swarmros::introspection::Field
const Serializer_serializer
 Serializer. More...
 

Detailed Description

Field for constant values.

Definition at line 13 of file ConstantField.h.

Constructor & Destructor Documentation

ConstantField::ConstantField ( const std::string &  name,
const Serializer serializer,
const std::string &  value 
)

Construct a new ConstantField object.

Parameters
nameName
serializerSerializer
valueValue

Definition at line 91 of file ConstantField.cpp.

Member Function Documentation

uint32_t ConstantField::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

Reimplemented from swarmros::introspection::Field.

Definition at line 158 of file ConstantField.cpp.

swarmio::data::Variant ConstantField::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

Reimplemented from swarmros::introspection::Field.

Definition at line 173 of file ConstantField.cpp.

void ConstantField::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

Reimplemented from swarmros::introspection::Field.

Definition at line 168 of file ConstantField.cpp.

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

Get the length of the default value.

Parameters
fieldStackStack of fields to determine location
Returns
uint32_t

Reimplemented from swarmros::introspection::Field.

Definition at line 153 of file ConstantField.cpp.

void ConstantField::ParseBool ( const std::string &  value)
private

Parse a boolean value.

Parameters
valueValue

Definition at line 24 of file ConstantField.cpp.

void ConstantField::ParseFloat ( const std::string &  value)
private

Parse a floating point value.

Parameters
valueValue

Definition at line 71 of file ConstantField.cpp.

void ConstantField::ParseSigned ( const std::string &  value)
private

Parse a signed integer value.

Parameters
valueValue

Definition at line 57 of file ConstantField.cpp.

void ConstantField::ParseString ( const std::string &  value)
private

Parse a string value.

Parameters
valueValue

Definition at line 85 of file ConstantField.cpp.

void ConstantField::ParseUnsigned ( const std::string &  value)
private

Parse an unsigned integer value.

Parameters
valueValue

Definition at line 43 of file ConstantField.cpp.

void ConstantField::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

Reimplemented from swarmros::introspection::Field.

Definition at line 163 of file ConstantField.cpp.

void ConstantField::WriteDefinition ( std::stringstream &  stream,
bool  forHash 
) const
overridevirtual

Write the definition of this field to a string stream.

Parameters
streamStream
forHashTrue if the definition will be used for the MD5 hash

Reimplemented from swarmros::introspection::Field.

Definition at line 140 of file ConstantField.cpp.

Member Data Documentation

std::string swarmros::introspection::ConstantField::_rawValue
private

Raw string value.

Definition at line 27 of file ConstantField.h.

swarmio::data::Variant swarmros::introspection::ConstantField::_value
private

Value.

Definition at line 21 of file ConstantField.h.


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


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