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

Default implementation of the IEntries API. More...

#include <group_table.h>

+ Inheritance diagram for HF::Core::GroupTable::Entries:
+ Collaboration diagram for HF::Core::GroupTable::Entries:

Public Member Functions

uint16_t size () const
 Return the number of entries in the container. More...
 
void clear ()
 Clear all entries in database.
 
void for_each (uint16_t group, std::function< void(const Entry &)> func) const
 Call the given function for all the entries with given group address. More...
 
Entry const & operator[] (uint8_t index) const
 Retrive the entry at the given index. More...
 
- Public Member Functions inherited from HF::Common::IEntries< Entry >
virtual Result save (const Entry &entry)=0
 Store the given entry to persistent storage. More...
 
virtual Result destroy (const Entry &entry)=0
 Destroy the given entry in the persistent storage. More...
 

Protected Member Functions

bool any_of (uint16_t group, uint8_t unit) const
 Check if there exists any entry for the group/unit address given. More...
 

Protected Attributes

Container db
 Group table entries database. More...
 

Detailed Description

Default implementation of the IEntries API.

Definition at line 404 of file group_table.h.

Member Function Documentation

◆ any_of()

bool HF::Core::GroupTable::Entries::any_of ( uint16_t  group,
uint8_t  unit 
) const
protected

Check if there exists any entry for the group/unit address given.

Parameters
[in]groupthe group address to search for.
[in]unitthe unit ID to search for.
Return values
trueif an entry exists,
falseotherwise.

◆ for_each()

void HF::Core::GroupTable::Entries::for_each ( uint16_t  group,
std::function< void(const Entry &)>  func 
) const
virtual

Call the given function for all the entries with given group address.

Parameters
[in]groupgroup address to search for.
[in]funcfunction to apply to each member of the group.

Implements HF::Core::GroupTable::IEntries.

◆ operator[]()

Entry const& HF::Core::GroupTable::Entries::operator[] ( uint8_t  index) const
inlinevirtual

Retrive the entry at the given index.

Parameters
[in]indexthe index to retrive the entry from.
Returns
a reference to the requested entry.

Implements HF::Core::GroupTable::IEntries.

Definition at line 418 of file group_table.h.

References db.

419  {
420  return db.at(index);
421  }
Container db
Group table entries database.
Definition: group_table.h:436

◆ size()

uint16_t HF::Core::GroupTable::Entries::size ( ) const
virtual

Return the number of entries in the container.

Returns
the number of entries in the container.

Implements HF::Common::IEntries< Entry >.

Field Documentation

◆ db

Container HF::Core::GroupTable::Entries::db
protected

Group table entries database.

Definition at line 436 of file group_table.h.

Referenced by operator[]().


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