ArrayField.h
Go to the documentation of this file.
1 #pragma once
2 
4 
6 {
11  class ArrayField : public Field
12  {
13  public:
14 
19  using Field::Field;
20 
28  virtual void WriteDefinition(std::stringstream& stream, bool forHash) const override;
29 
36  virtual uint32_t GetDefaultLength(const FieldStack& fieldStack) const override;
37 
45  virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant& value, const FieldStack& fieldStack) const override;
46 
54  virtual void Serialize(ros::serialization::OStream& stream, const swarmio::data::Variant& value, const FieldStack& fieldStack) const override;
55 
63  virtual void SerializeCount(ros::serialization::OStream& stream, uint32_t count, const FieldStack& fieldStack) const;
64 
71  virtual void EmitDefault(ros::serialization::OStream& stream, const FieldStack& fieldStack) const override;
72 
80  virtual swarmio::data::Variant Deserialize(ros::serialization::IStream& stream, const FieldStack& fieldStack) const override;
81 
89  virtual uint32_t DeserializeCount(ros::serialization::IStream& stream, const FieldStack& fieldStack) const;
90 
96  virtual swarmio::data::discovery::Field GetFieldDescriptor() const override;
97  };
98 }
Field for dynamic arrays.
Definition: ArrayField.h:11
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const override
Get the length of the default value.
Definition: ArrayField.cpp:25
virtual uint32_t DeserializeCount(ros::serialization::IStream &stream, const FieldStack &fieldStack) const
Deserialize the count of the array from a stream.
Definition: ArrayField.cpp:60
A Field represents an entry in a message reader that can read one of its fields.
Definition: Field.h:15
virtual void Serialize(ros::serialization::OStream &stream, const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
Serialize a variant onto a stream.
Definition: ArrayField.cpp:36
virtual swarmio::data::discovery::Field GetFieldDescriptor() const override
Build a field descriptor for the underlying type.
Definition: ArrayField.cpp:67
virtual void SerializeCount(ros::serialization::OStream &stream, uint32_t count, const FieldStack &fieldStack) const
Serialize the count of the array onto a stream.
Definition: ArrayField.cpp:43
virtual swarmio::data::Variant Deserialize(ros::serialization::IStream &stream, const FieldStack &fieldStack) const override
Deserialize a stream into a variant.
Definition: ArrayField.cpp:53
Field(const std::string &name, const Serializer &serializer)
Construct a new Field object.
Definition: Field.h:41
virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
Calculate the length of a serialized message in bytes.
Definition: ArrayField.cpp:30
virtual void WriteDefinition(std::stringstream &stream, bool forHash) const override
Write the definition of this field to a string stream.
Definition: ArrayField.cpp:10
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const override
Write the default value to the stream.
Definition: ArrayField.cpp:48


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