Default implementation of the persistence API.
More...
#include <batch_program_management.h>
|
uint16_t | size () const |
| Return the number of entries in the container. More...
|
|
Common::Result | save (const uint8_t pid, const std::string &name, std::vector< Action > &actions) |
| Store the given entry to persistent storage. More...
|
|
Common::Result | destroy (const uint8_t pid) |
| Remove the program with the given pid ftom. More...
|
|
Common::Result | destroy (const Entry &entry) |
| Destroy the given entry in the persistent storage. More...
|
|
void | clear (void) |
| Erase all the DB entries.
|
|
EntryPtr | find (const uint8_t pid) const |
| Find the program with the given pid . More...
|
|
EntryPtr | find (const std::string &name) const |
| Find the program with the given name . More...
|
|
uint8_t | next_pid () const |
| Return next available PID for the program. 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 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...
|
|
|
Container | db |
| Actual container for the entries.
|
|
Default implementation of the persistence API.
Definition at line 414 of file batch_program_management.h.
◆ begin() [1/2]
iterator HF::Core::BatchProgramManagement::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 453 of file batch_program_management.h.
References db.
Container db
Actual container for the entries.
◆ begin() [2/2]
const_iterator HF::Core::BatchProgramManagement::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 473 of file batch_program_management.h.
References db.
Container db
Actual container for the entries.
◆ destroy() [1/2]
Common::Result HF::Core::BatchProgramManagement::Entries::destroy |
( |
const uint8_t |
pid | ) |
|
|
virtual |
Remove the program with the given pid
ftom.
- Parameters
-
[in] | pid | the Program ID to destroy. |
- Return values
-
Result::OK | if the entry was destroyed, |
Result::FAIL_ARG | if no entry with pid exists, |
Result::FAIL_UNKNOWN | otherwise. |
Implements HF::Core::BatchProgramManagement::IEntries.
◆ destroy() [2/2]
Common::Result HF::Core::BatchProgramManagement::Entries::destroy |
( |
const Entry & |
entry | ) |
|
Destroy the given entry
in the persistent storage.
- Parameters
-
[in] | entry | reference to the entry to erase. |
- Return values
-
Common::Result::OK,if | the entry was destroyed. |
Common::Result::FAIL_ARG | otherwise. |
- 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::BatchProgramManagement::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 463 of file batch_program_management.h.
References db.
Container db
Actual container for the entries.
◆ end() [2/2]
const_iterator HF::Core::BatchProgramManagement::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 483 of file batch_program_management.h.
References db.
Container db
Actual container for the entries.
◆ find() [1/2]
EntryPtr HF::Core::BatchProgramManagement::Entries::find |
( |
const uint8_t |
pid | ) |
const |
|
virtual |
◆ find() [2/2]
EntryPtr HF::Core::BatchProgramManagement::Entries::find |
( |
const std::string & |
name | ) |
const |
|
virtual |
◆ next_pid()
uint8_t HF::Core::BatchProgramManagement::Entries::next_pid |
( |
| ) |
const |
|
virtual |
◆ save()
Common::Result HF::Core::BatchProgramManagement::Entries::save |
( |
const uint8_t |
pid, |
|
|
const std::string & |
name, |
|
|
std::vector< Action > & |
actions |
|
) |
| |
|
virtual |
Store the given entry
to persistent storage.
- Parameters
-
[in] | pid | Program ID for the new entry. |
[in] | name | name for the new batch program. |
[in] | actions | Action list for the batch program. |
- Return values
-
Common::Result::OK | if the entry was saved, |
Common::Result::FAIL_UNKNOWN | otherwise. |
Implements HF::Core::BatchProgramManagement::IEntries.
◆ size()
uint16_t HF::Core::BatchProgramManagement::Entries::size |
( |
| ) |
const |
|
virtual |
The documentation for this struct was generated from the following file: