FixedArrayField.h
Go to the documentation of this file.
1 #pragma once
2 
4 
6 {
11  class FixedArrayField : public ArrayField
12  {
13  private:
14 
19  uint32_t _count;
20 
21  public:
22 
30  FixedArrayField(const std::string& name, const Serializer& serializer, uint32_t count)
31  : ArrayField(name, serializer), _count(count) { }
32 
40  virtual void WriteDefinition(std::stringstream& stream, bool forHash) const override;
41 
48  virtual uint32_t GetDefaultLength(const FieldStack& fieldStack) const override;
49 
57  virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant& value, const FieldStack& fieldStack) const override;
58 
66  virtual void SerializeCount(ros::serialization::OStream& stream, uint32_t count, const FieldStack& fieldStack) const override;
67 
74  virtual void EmitDefault(ros::serialization::OStream& stream, const FieldStack& fieldStack) const override;
75 
83  virtual uint32_t DeserializeCount(ros::serialization::IStream& stream, const FieldStack& fieldStack) const override;
84 
90  virtual swarmio::data::discovery::Field GetFieldDescriptor() const override;
91  };
92 }
Field for dynamic arrays.
Definition: ArrayField.h:11
virtual uint32_t DeserializeCount(ros::serialization::IStream &stream, const FieldStack &fieldStack) const override
Deserialize the count of the array from a stream.
Serializer for fixed arrays.
FixedArrayField(const std::string &name, const Serializer &serializer, uint32_t count)
Construct a new FixedArrayField object.
virtual swarmio::data::discovery::Field GetFieldDescriptor() const override
Build a field descriptor for the underlying type.
virtual void SerializeCount(ros::serialization::OStream &stream, uint32_t count, const FieldStack &fieldStack) const override
Serialize the count of the array onto a stream.
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const override
Get the length of the default value.
virtual uint32_t CalculateSerializedLength(const swarmio::data::Variant &value, const FieldStack &fieldStack) const override
Calculate the length of a serialized message in bytes.
virtual void WriteDefinition(std::stringstream &stream, bool forHash) const override
Write the definition of this field to a string stream.
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const override
Write the default value to the stream.
Serializer is the base class for all binary message interpreters.
Definition: Serializer.h:17


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