16 if (forHash && dynamic_cast<const MessageSerializer*>(&
_serializer) !=
nullptr)
39 "Invalid count for FixedArrayField",
55 "Invalid count for FixedArrayField",
65 for (uint32_t i = 0; i <
_count; ++i)
80 field.set_fixed_size(
_count);
virtual uint32_t DeserializeCount(ros::serialization::IStream &stream, const FieldStack &fieldStack) const override
Deserialize the count of the array from a stream.
Exception thrown when the count of a fixed array does not match the count of the variant array...
virtual swarmio::data::discovery::Field GetFieldDescriptor() const =0
Build a field descriptor for the underlying type.
virtual std::string GetLocation() const =0
Construct the current location.
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.
static size_t GetCount(const Variant &value)
Get the item count of the variant array, or 1 if it is not an array.
virtual void WriteDefinition(std::stringstream &stream, bool forHash) const
Write the definition of this field to a string stream.
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const =0
Write the default value to the stream.
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const override
Get the length of the default value.
virtual const std::string & GetFullName() const
Get the fully qualified name for the type behind the serializer.
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.
const Serializer & _serializer
Serializer.
virtual void EmitDefault(ros::serialization::OStream &stream, const FieldStack &fieldStack) const override
Write the default value to the stream.
const std::string & GetName() const
Get the non-qualified name for the type behind the serializer.
uint32_t _count
Element count.
virtual uint32_t GetDefaultLength(const FieldStack &fieldStack) const =0
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.