Open Lighting Architecture
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
ola::messaging::FieldDescriptorGroup Class Reference

Detailed Description

A FieldDescriptor that consists of a group of FieldDescriptors. Groups can vary in size two ways. First, the group may contain a field which itself is of variable size (i.e. a string or another group). This type of message structure requires some other data in the message itself to indicate the field/group length and as such isn't supported.

An example of this type of group would be:

+-------------—+ | bool (1) | +-------------—+ | string (0, 32) | +-------------—+

This could hold data like: (true, "foo"), (false, "bar)

The second (and simpler) type is where the group size is fixed (i.e. contains only fixed length fields) and the number of times the group appears in the message varies. By knowing the length of the message we can work out the number of times a group occurs (see VariableFieldSizeCalculator.h which does this).

An example of this type of group would be:

+-------------—+ | bool (1) | +-------------—+ | uint16 (2) | +-------------—+

This could hold data like: (true, 1000), (false, 34)

DescriptorConsistencyChecker.h checks that a descriptor is the second type, that is contains at most one variable-sized field.

We refer to the datatypes within a group as fields, the actual instantiations of a group as blocks. In the examples above, bool, string and uint16 are the fields (represented by FieldDescriptorInterface objects) and (true, "foo") & (true, 1000) are the blocks.

Inheritance diagram for ola::messaging::FieldDescriptorGroup:
ola::messaging::FieldDescriptor ola::messaging::FieldDescriptorInterface ola::messaging::Descriptor

Public Member Functions

 FieldDescriptorGroup (const string &name, const vector< const FieldDescriptor * > &fields, uint16_t min_blocks, int16_t max_blocks)
bool FixedSize () const
bool LimitedSize () const
unsigned int MaxSize () const
unsigned int FieldCount () const
bool FixedBlockSize () const
unsigned int BlockSize () const
unsigned int MaxBlockSize () const
uint16_t MinBlocks () const
int16_t MaxBlocks () const
bool FixedBlockCount () const
class FieldDescriptorGetField (unsigned int index) const
virtual void Accept (FieldDescriptorVisitor *visitor) const
- Public Member Functions inherited from ola::messaging::FieldDescriptor
 FieldDescriptor (const string &name)
const string & Name () const

Static Public Attributes

static const int16_t UNLIMITED_BLOCKS = -1

Protected Attributes

vector< const class
FieldDescriptor * > 
m_fields

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