HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
HF::Core::Scheduling::IEntries< _Type > Struct Template Referenceabstract

Scheduling - Persistent Storage API. More...

#include <scheduling.h>

+ Inheritance diagram for HF::Core::Scheduling::IEntries< _Type >:
+ Collaboration diagram for HF::Core::Scheduling::IEntries< _Type >:

Public Types

typedef Entry< _Type > EntryType
 Entry helper type. More...
 
typedef Common::Pointer< EntryTypeEntryPointer
 Entry pointer helper. More...
 

Public Member Functions

virtual Common::Result save (const EntryType &entry)=0
 Store the given entry to persistent storage. More...
 
virtual void clear (void)=0
 Erase all the DB entries.
 
virtual EntryPointer find (uint8_t id) const =0
 Find the Event with the given id. More...
 
virtual uint8_t next_id () const =0
 Return next available id for event. More...
 
virtual void for_each (std::function< void(EntryType &e)> func)=0
 Call the given function with each entry in the DB as argument. More...
 
- Public Member Functions inherited from HF::Common::IEntries< Entry< _Type > >
virtual uint16_t size () const=0
 Return the number of entries in the container. More...
 
virtual Result save (const Entry< _Type > &entry)=0
 Store the given entry to persistent storage. More...
 
virtual Result destroy (const Entry< _Type > &entry)=0
 Destroy the given entry in the persistent storage. More...
 

Detailed Description

template<typename _Type>
struct HF::Core::Scheduling::IEntries< _Type >

Scheduling - Persistent Storage API.

Template Parameters
_Typethe specific type of the scheduling entry.

Definition at line 483 of file scheduling.h.

Member Typedef Documentation

◆ EntryPointer

template<typename _Type >
typedef Common::Pointer<EntryType> HF::Core::Scheduling::IEntries< _Type >::EntryPointer

Entry pointer helper.

Definition at line 486 of file scheduling.h.

◆ EntryType

template<typename _Type >
typedef Entry<_Type> HF::Core::Scheduling::IEntries< _Type >::EntryType

Entry helper type.

Definition at line 485 of file scheduling.h.

Member Function Documentation

◆ find()

template<typename _Type >
virtual EntryPointer HF::Core::Scheduling::IEntries< _Type >::find ( uint8_t  id) const
pure virtual

Find the Event with the given id.

Parameters
[in]idEvent ID to search for.
Returns
pointer to the entry with the given id, nullptr otherwise.

Implemented in HF::Core::Scheduling::Entries< _Type >.

◆ for_each()

template<typename _Type >
virtual void HF::Core::Scheduling::IEntries< _Type >::for_each ( std::function< void(EntryType &e)>  func)
pure virtual

Call the given function with each entry in the DB as argument.

Parameters
[in]funcfunction to apply to all entries in the store.

◆ next_id()

template<typename _Type >
virtual uint8_t HF::Core::Scheduling::IEntries< _Type >::next_id ( ) const
pure virtual

Return next available id for event.

Returns
the id to use in the next event, or Scheduler::Entry::AVAILABLE_ID if no id is available.

Implemented in HF::Core::Scheduling::Entries< _Type >.

◆ save()

template<typename _Type >
virtual Common::Result HF::Core::Scheduling::IEntries< _Type >::save ( const EntryType entry)
pure virtual

Store the given entry to persistent storage.

Parameters
[in]entrythe entry to save.
Return values
Common::Result::OKif the entry was saved,
Common::Result::FAIL_ARGif an entry already exists with the same ID,
Common::Result::FAIL_UNKNOWNotherwise.

Implemented in HF::Core::Scheduling::Entries< _Type >.


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