1 #ifndef ACE_UTILS_MODE_GROUP_MODE_NAVIGATOR_H
2 #define ACE_UTILS_MODE_GROUP_MODE_NAVIGATOR_H
23 mCurrModeIterator{rootModeGroup, 0} {
24 updateCurrentModeId();
28 uint8_t
modeId()
const {
return mModeId; }
32 ace_common::incrementMod(
33 mCurrModeIterator.recordIndex,
35 updateCurrentModeId();
51 mCurrModeIterator = mPrevModeIterator;
56 ? &children[mCurrModeIterator.recordIndex]
59 mPrevModeIterator = mCurrModeIterator;
60 mCurrModeIterator.group = childRecord->
childGroup;
61 mCurrModeIterator.recordIndex = 0;
65 updateCurrentModeId();
69 void updateCurrentModeId() {
70 mModeId = mCurrModeIterator.group->
children
72 mCurrModeIterator.recordIndex].
modeId
76 ModeIterator mCurrModeIterator;
77 ModeIterator mPrevModeIterator;
78 uint8_t mModeId = kModeUnknown;
A class that helps navigate the hierarchical ModeGroup tree defined by the rootModeGroup.
void changeMode()
Move to the next sibling mode and wrap to 0 if the end is reached.
uint8_t modeId() const
Return the current mode identifier.
ModeNavigator(ModeGroup const *rootModeGroup)
Constructor.
void changeGroup()
Alternate between a root group and a child group, going to the first mode of the group.
A data structure that captures the group of sibliing clock modes which can be cycled through using th...
const ModeRecord *const children
Array of children mode groups.
uint8_t const numModes
Number of modes.
const ModeGroup *const parentGroup
Pointer to the parent ModeGroup.
A record of a child of a ModeGroup.
uint8_t const modeId
Unique integer identifier of the mode.
const ModeGroup *const childGroup
ModeGroup containing children ModeRecords.