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

Default implementation of the persistence API. More...

#include <device_management.h>

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

Public Member Functions

uint16_t size () const
 Return the number of entries in the container. More...
 
Common::Result destroy (const Device &entry)
 Destroy the given entry in the persistent storage. More...
 
DevicePtr find (uint16_t address) const
 Return the Device entry for the given address. More...
 
DevicePtr find (const HF::UID::UID &uid) const
 Return the Device entry for the given UID. More...
 
uint16_t next_address () const
 Return next available address for registering a device. More...
 
iterator begin ()
 Get an iterator to the start of the entries in this container. More...
 
iterator end ()
 Get an iterator to the end of the entries in this container. More...
 
const_iterator begin () const
 Get a constant iterator to the start of the entries in this container. More...
 
const_iterator end () const
 Get a constant iterator to the start of the entries in this container. More...
 
- Public Member Functions inherited from HF::Common::IEntries< Device >
virtual Result save (const Device &entry)=0
 Store the given entry to persistent storage. More...
 
virtual Result destroy (const Device &entry)=0
 Destroy the given entry in the persistent storage. More...
 

Protected Attributes

Container db
 Actual container for the entries.
 

Detailed Description

Default implementation of the persistence API.

Definition at line 770 of file device_management.h.

Member Function Documentation

◆ begin() [1/2]

iterator HF::Core::DeviceManagement::Entries::begin ( )
inline

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

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

Definition at line 804 of file device_management.h.

References db.

805  {
806  return db.begin();
807  }
Container db
Actual container for the entries.

◆ begin() [2/2]

const_iterator HF::Core::DeviceManagement::Entries::begin ( ) const
inline

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

Returns
constant iterator to the start of the entries present in this container.

Definition at line 824 of file device_management.h.

References db.

825  {
826  return db.cbegin();
827  }
Container db
Actual container for the entries.

◆ destroy()

Common::Result HF::Core::DeviceManagement::Entries::destroy ( const Device entry)

Destroy the given entry in the persistent storage.

Parameters
[in]entryreference to the entry to erase.
Return values
Common::Result::OK,ifthe entry was destroyed.
Common::Result::FAIL_ARGotherwise.
Warning
the reference passed into this method SHOULD NOT be considered valid if it was obtained by calling the find method.

◆ end() [1/2]

iterator HF::Core::DeviceManagement::Entries::end ( )
inline

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

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

Definition at line 814 of file device_management.h.

References db.

815  {
816  return db.end();
817  }
Container db
Actual container for the entries.

◆ end() [2/2]

const_iterator HF::Core::DeviceManagement::Entries::end ( ) const
inline

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

Returns
constant iterator to the start of the entries present in this container.

Definition at line 834 of file device_management.h.

References db.

835  {
836  return db.cend();
837  }
Container db
Actual container for the entries.

◆ find() [1/2]

DevicePtr HF::Core::DeviceManagement::Entries::find ( uint16_t  address) const
virtual

Return the Device entry for the given address.

Parameters
[in]addressthe device address.
Return values
apointer to the Device entry associated with the given address,
nullptrif the entry does not exist.

Implements HF::Core::DeviceManagement::IEntries.

◆ find() [2/2]

DevicePtr HF::Core::DeviceManagement::Entries::find ( const HF::UID::UID uid) const
virtual

Return the Device entry for the given UID.

Parameters
[in]uidthe device UID.
Return values
apointer the Device entry associated with the given UID,
nullptrif the entry does not exist.

Implements HF::Core::DeviceManagement::IEntries.

◆ next_address()

uint16_t HF::Core::DeviceManagement::Entries::next_address ( ) const
virtual

Return next available address for registering a device.

Returns
the address to use in the next registration.

Implements HF::Core::DeviceManagement::IEntries.

◆ size()

uint16_t HF::Core::DeviceManagement::Entries::size ( ) const
inlinevirtual

Return the number of entries in the container.

Returns
the number of entries in the container.

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

Definition at line 777 of file device_management.h.

References db.

778  {
779  return db.size();
780  }
Container db
Actual container for the entries.

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