Default implementation of the persistence API.
More...
#include <group_management.h>
|
uint16_t | size () const |
| Return the number of entries in the container. More...
|
|
Common::Result | save (uint16_t address, const std::string &name) |
| Store the given entry to persistent storage. More...
|
|
Common::Result | destroy (const uint16_t address) |
| Destroy the entry given by address in the persistent storage. More...
|
|
Common::Result | destroy (const Group &entry) |
| Destroy the given entry in the persistent storage. More...
|
|
GroupPtr | find (uint16_t address) const |
| Find the group with the given group address . More...
|
|
GroupPtr | find (const std::string &name) const |
| Find the group with the given name . More...
|
|
uint16_t | next_address () const |
| Return next available address for device group. 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...
|
|
virtual Result | save (const Group &entry)=0 |
| Store the given entry to persistent storage. More...
|
|
virtual Result | destroy (const Group &entry)=0 |
| Destroy the given entry in the persistent storage. More...
|
|
|
Container | db |
| Actual container for the entries.
|
|
Default implementation of the persistence API.
Definition at line 641 of file group_management.h.
◆ begin() [1/2]
iterator HF::Core::GroupManagement::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 682 of file group_management.h.
References db.
Container db
Actual container for the entries.
◆ begin() [2/2]
const_iterator HF::Core::GroupManagement::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 702 of file group_management.h.
References db.
Container db
Actual container for the entries.
◆ destroy() [1/2]
Common::Result HF::Core::GroupManagement::Entries::destroy |
( |
const uint16_t |
address | ) |
|
|
virtual |
Destroy the entry given by address
in the persistent storage.
- Parameters
-
[in] | address | the address to the entry to erase. |
- Return values
-
Common::Result::OK,if | the entry was destroyed. |
Common::Result::FAIL_ARG | otherwise. |
Implements HF::Core::GroupManagement::IEntries.
◆ destroy() [2/2]
Destroy the given entry
in the persistent storage.
- Warning
- the reference passed into this method SHOULD NOT be considered valid if it was obtained by calling the find method.
- Parameters
-
[in] | entry | reference to the entry to erase. |
- Return values
-
Common::Result::OK,if | the entry was destroyed. |
Common::Result::FAIL_ARG | otherwise. |
◆ end() [1/2]
iterator HF::Core::GroupManagement::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 692 of file group_management.h.
References db.
Container db
Actual container for the entries.
◆ end() [2/2]
const_iterator HF::Core::GroupManagement::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 712 of file group_management.h.
References db.
Container db
Actual container for the entries.
◆ find() [1/2]
GroupPtr HF::Core::GroupManagement::Entries::find |
( |
uint16_t |
address | ) |
const |
|
virtual |
Find the group with the given group address
.
- Parameters
-
[in] | address | HF address to search for. |
- Returns
- pointer to the group with the given
address
, nullptr
otherwise.
Implements HF::Core::GroupManagement::IEntries.
◆ find() [2/2]
GroupPtr HF::Core::GroupManagement::Entries::find |
( |
const std::string & |
name | ) |
const |
|
virtual |
Find the group with the given name
.
- Parameters
-
[in] | name | group name to search for. |
- Returns
- pointer to the group with the given
name
, nullptr
otherwise.
Implements HF::Core::GroupManagement::IEntries.
◆ next_address()
uint16_t HF::Core::GroupManagement::Entries::next_address |
( |
| ) |
const |
|
virtual |
◆ save()
Common::Result HF::Core::GroupManagement::Entries::save |
( |
uint16_t |
address, |
|
|
const std::string & |
name |
|
) |
| |
|
virtual |
Store the given entry
to persistent storage.
- Parameters
-
[in] | address | HF group address for the new group. |
[in] | name | name for the new group. |
- Return values
-
Common::Result::OK | if the entry was saved, |
Common::Result::FAIL_UNKNOWN | otherwise. |
Implements HF::Core::GroupManagement::IEntries.
◆ size()
uint16_t HF::Core::GroupManagement::Entries::size |
( |
| ) |
const |
|
virtual |
The documentation for this struct was generated from the following file: