class PersistedCounter
Defined at line 44 of file x64-shared/gen/third_party/openweave-core/src/include/Weave/Support/PersistedCounter.h
A class for managing a counter as an integer value intended to persist
across reboots.
Public Methods
void PersistedCounter ()
void ~PersistedCounter ()
WEAVE_ERROR Init (const nl::Weave::Platform::PersistedStorage::Key aId, uint32_t aEpoch)
Initialize a PersistedCounter object.
Parameters
Returns
WEAVE_ERROR_INVALID_ARGUMENT if aId is NULL
WEAVE_ERROR_INVALID_STRING_LENGTH if aId is longer than
WEAVE_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH.
WEAVE_ERROR_INVALID_INTEGER_VALUE if aEpoch is 0.
WEAVE_NO_ERROR otherwise
WEAVE_ERROR Advance ()
Increment the counter and write to persisted storage if we've completed
the current epoch.
Returns
Any error returned by a write to persisted storage.
WEAVE_ERROR AdvanceEpochRelative (uint32_t aValue)
Advance the counter to start of the epoch following the provided
value.
Returns
Any error returned by a write to persistent storage.
WEAVE_ERROR SetValue (uint32_t value)
This is used to set the event counter from persisted events