HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::AttributeReporting::Periodic::Rule Struct Reference

This class represents a periodic rule for attribute reporting. More...

#include <attribute_reporting.h>

+ Inheritance diagram for HF::Core::AttributeReporting::Periodic::Rule:
+ Collaboration diagram for HF::Core::AttributeReporting::Periodic::Rule:

Public Member Functions

 Rule (uint32_t _interval=0)
 Constructor. More...
 
void add (const Entry &entry)
 Add the given entry to rule. More...
 
void clear ()
 Remove all entries in this rule.
 
uint16_t entries_count ()
 Number of entries present in this rule. More...
 
iterator begin ()
 Get an iterator to the start of the entries in this rule. More...
 
iterator end ()
 Get an iterator to the end of the entries in this rule. More...
 
const_iterator cbegin () const
 Get a constant iterator to the start of the entries in this rule. More...
 
const_iterator cend () const
 Get constant iterator to the end of the entries in this rule. More...
 
- Public Member Functions inherited from HF::Core::AttributeReporting::Rule
uint16_t size () const
 Number bytes needed to serialize the message. More...
 
uint16_t pack (Common::ByteArray &array, uint16_t offset=0) const
 Write the object on to a ByteArray so it can be sent over the network. More...
 
uint16_t unpack (const Common::ByteArray &array, uint16_t offset=0)
 Read a message from a ByteArray. More...
 

Data Fields

uint32_t interval
 Attribute indicating the time interval rule needs to be activated.
 
uint32_t last_time
 Attribute indicating the last time rule was activated.
 
- Data Fields inherited from HF::Core::AttributeReporting::Rule
Reference report
 Report reference this rule generates.
 
Protocol::Address destination
 Device/unit that will receive the report.
 

Static Public Attributes

static constexpr uint16_t min_size
 Minimum pack/unpack required data size.
 
- Static Public Attributes inherited from HF::Core::AttributeReporting::Rule
static constexpr uint16_t min_size
 Minimum pack/unpack required data size.
 

Protected Attributes

Container entries
 Container for the entries of the periodic rule.
 

Additional Inherited Members

- Protected Member Functions inherited from HF::Core::AttributeReporting::Rule
 Rule (Type type)
 Constructor. More...
 

Detailed Description

This class represents a periodic rule for attribute reporting.

Definition at line 235 of file attribute_reporting.h.

Constructor & Destructor Documentation

◆ Rule()

HF::Core::AttributeReporting::Periodic::Rule::Rule ( uint32_t  _interval = 0)
inline

Constructor.

Parameters
[in]_intervalperiodic rule interval value.

Definition at line 254 of file attribute_reporting.h.

254  : AttributeReporting::Rule(PERIODIC),
255  interval(_interval),
256  last_time(0)
257  {}
uint32_t interval
Attribute indicating the time interval rule needs to be activated.
uint32_t last_time
Attribute indicating the last time rule was activated.

Member Function Documentation

◆ add()

void HF::Core::AttributeReporting::Periodic::Rule::add ( const Entry entry)
inline

Add the given entry to rule.

Parameters
[in]entryreference to the entry to add to this rule.

Definition at line 275 of file attribute_reporting.h.

References entries.

276  {
277  entries.push_front(entry);
278  }
Container entries
Container for the entries of the periodic rule.

◆ begin()

iterator HF::Core::AttributeReporting::Periodic::Rule::begin ( )
inline

Get an iterator to the start of the entries in this rule.

Returns
iterator to the start of the entries present in this rule.

Definition at line 304 of file attribute_reporting.h.

References entries.

305  {
306  return entries.begin();
307  }
Container entries
Container for the entries of the periodic rule.

◆ cbegin()

const_iterator HF::Core::AttributeReporting::Periodic::Rule::cbegin ( ) const
inline

Get a constant iterator to the start of the entries in this rule.

Returns
iterator to the start of the entries present in this rule.

Definition at line 324 of file attribute_reporting.h.

References entries.

325  {
326  return entries.cbegin();
327  }
Container entries
Container for the entries of the periodic rule.

◆ cend()

const_iterator HF::Core::AttributeReporting::Periodic::Rule::cend ( ) const
inline

Get constant iterator to the end of the entries in this rule.

Returns
iterator to the end of the entries present in this rule.

Definition at line 334 of file attribute_reporting.h.

References entries.

335  {
336  return entries.cend();
337  }
Container entries
Container for the entries of the periodic rule.

◆ end()

iterator HF::Core::AttributeReporting::Periodic::Rule::end ( )
inline

Get an iterator to the end of the entries in this rule.

Returns
iterator to the end of the entries present in this rule.

Definition at line 314 of file attribute_reporting.h.

References entries.

315  {
316  return entries.end();
317  }
Container entries
Container for the entries of the periodic rule.

◆ entries_count()

uint16_t HF::Core::AttributeReporting::Periodic::Rule::entries_count ( )
inline

Number of entries present in this rule.

Returns
number of entries present in this rule.

Definition at line 293 of file attribute_reporting.h.

References entries.

294  {
295  return std::distance(entries.begin(), entries.end());
296  }
Container entries
Container for the entries of the periodic rule.

The documentation for this struct was generated from the following file: