EmlaLockSafe
views::ViewStore Class Reference

Class managing which holds static references to all views which can be accessed over the ViewId without including any views. This ensures that no include loops are necessary. More...

#include <ViewStore.h>

Public Types

enum  ViewId {
  ConfigurationServerView , EmergencyEnterKeyView , EmergencyEnterMenuView , EmergencyMenu ,
  EmlalockUnlockKeyMenu , HardwareTestView , HygieneOpeningMenu , LockedView ,
  PreferencesMenu , SelectDisplayTimeLeft , SelectDisplayTimePassed , SetTimerView ,
  TimeRestrictedView , UnlockedMainMenu , UnlockSafeView , WifiConnectingView
}
 IDs of the different views. More...
 

Static Public Member Functions

static lcd::ViewBase * getView (const ViewId &id)
 Returns the pointer to the view registered by the given id. More...
 
static void addView (const ViewId &id, lcd::ViewBase &view)
 registers a new view More...
 
static bool activateView (const ViewId &id)
 activates the view described by the id More...
 

Protected Member Functions

 ViewStore ()
 protected, use the static functions instead More...
 

Static Protected Member Functions

static ViewStoregetSingleton ()
 Get the Singleton object if the ViewStore. More...
 

Protected Attributes

std::map< ViewId, lcd::ViewBase * > views
 Map linking the IDs. More...
 

Detailed Description

Class managing which holds static references to all views which can be accessed over the ViewId without including any views. This ensures that no include loops are necessary.

To activate a view use views::ViewStore::activateView(views::ViewStore::HardwareTestView);

Member Enumeration Documentation

◆ ViewId

IDs of the different views.

Enumerator
ConfigurationServerView 
EmergencyEnterKeyView 
EmergencyEnterMenuView 
EmergencyMenu 
EmlalockUnlockKeyMenu 
HardwareTestView 
HygieneOpeningMenu 
LockedView 
PreferencesMenu 
SelectDisplayTimeLeft 
SelectDisplayTimePassed 
SetTimerView 
TimeRestrictedView 
UnlockedMainMenu 
UnlockSafeView 
WifiConnectingView 

Constructor & Destructor Documentation

◆ ViewStore()

views::ViewStore::ViewStore ( )
inlineprotected

protected, use the static functions instead

Member Function Documentation

◆ activateView()

static bool views::ViewStore::activateView ( const ViewId id)
inlinestatic

activates the view described by the id

Parameters
idViewId of the view which should be activated
Returns
true if the view was known

◆ addView()

static void views::ViewStore::addView ( const ViewId id,
lcd::ViewBase &  view 
)
inlinestatic

registers a new view

Parameters
idViewId of the view which should be registered
viewpointer to the view which should be accessible using the ViewId

◆ getSingleton()

static ViewStore & views::ViewStore::getSingleton ( )
inlinestaticprotected

Get the Singleton object if the ViewStore.

◆ getView()

static lcd::ViewBase * views::ViewStore::getView ( const ViewId id)
inlinestatic

Returns the pointer to the view registered by the given id.

Parameters
idViewId of the view which should be returned
Returns
pointer to the requested view or nullptr if the view was not registered (yet)

Member Data Documentation

◆ views

std::map<ViewId, lcd::ViewBase*> views::ViewStore::views
protected

Map linking the IDs.


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