|
roo_prefs
API Documentation for roo_prefs
|
Similar to Pref<T>, but does not immediately store written data in persistent storage. Instead, writes with a delay, which depends on whether the data stabilized or keeps changing.
More...
Namespaces | |
| namespace | internal |
| Implementation details follow. | |
Data Structures | |
| class | Collection |
| Collection corresponds to a preferences namespace. Use it to group related preferences. More... | |
| class | LazyWritePref |
| class | Pref |
| Persistent preference of a specific type. The preference will store its value in the preferences collection provided in the constructor, under the specified key (which needs to remain constant). The value is read lazily (on first access.) You can provide default value to be used if the collection does not contain the specified key. The value is cached in memory - subsequent reads will return the cached value. Writes always write to the persistent storage (and also, update the cache.) Read and write are performed within implicitly created transactions. If you have multiple properties that you want to read/write at the same time, you can read them under an explicit transaction: More... | |
| class | PreferencesStore |
| Low-level wrapper around the underlying preferences storage. More... | |
| class | Transaction |
| Ref-counted RAII for managing access to Preference namespaces. Allows orchestrating access to the Store. More... | |
Typedefs | |
| using | Store = PreferencesStore |
| using | LazyBool = LazyWritePref< bool > |
| using | LazyUint8 = LazyWritePref< uint8_t > |
| using | LazyInt8 = LazyWritePref< int8_t > |
| using | LazyUint16 = LazyWritePref< uint16_t > |
| using | LazyInt16 = LazyWritePref< int16_t > |
| using | LazyUint32 = LazyWritePref< uint32_t > |
| using | LazyInt32 = LazyWritePref< int32_t > |
| using | LazyUint64 = LazyWritePref< uint64_t > |
| using | LazyInt64 = LazyWritePref< int64_t > |
| using | LazyFloat = LazyWritePref< float > |
| using | LazyDouble = LazyWritePref< double > |
| using | Bool = Pref< bool > |
| using | Uint8 = Pref< uint8_t > |
| using | Int8 = Pref< int8_t > |
| using | Uint16 = Pref< uint16_t > |
| using | Int16 = Pref< int16_t > |
| using | Uint32 = Pref< uint32_t > |
| using | Int32 = Pref< int32_t > |
| using | Uint64 = Pref< uint64_t > |
| using | Int64 = Pref< int64_t > |
| using | Float = Pref< float > |
| using | Double = Pref< double > |
| using | String = Pref< std::string > |
Enumerations | |
| enum class | ReadResult { kOk , kNotFound , kWrongType , kError } |
| Result of reading a value from storage. More... | |
| enum class | WriteResult { kOk , kError } |
| Result of writing a value to storage. More... | |
| enum class | ClearResult { kOk , kError } |
| Result of clearing a value from storage. More... | |
Functions | |
| const char * | ReadResultToString (ReadResult result) |
| const char * | WriteResultToString (WriteResult result) |
| const char * | ClearResultToString (ClearResult result) |
| roo_logging::Stream & | operator<< (roo_logging::Stream &os, ReadResult result) |
| roo_logging::Stream & | operator<< (roo_logging::Stream &os, WriteResult result) |
| roo_logging::Stream & | operator<< (roo_logging::Stream &os, ClearResult result) |
Variables | |
| constexpr ReadResult | READ_OK = ReadResult::kOk |
| constexpr ReadResult | READ_NOT_FOUND = ReadResult::kNotFound |
| constexpr ReadResult | READ_WRONG_TYPE = ReadResult::kWrongType |
| constexpr ReadResult | READ_ERROR = ReadResult::kError |
| constexpr WriteResult | WRITE_OK = WriteResult::kOk |
| constexpr WriteResult | WRITE_ERROR = WriteResult::kError |
| constexpr ClearResult | CLEAR_OK = ClearResult::kOk |
| constexpr ClearResult | CLEAR_ERROR = ClearResult::kError |
Similar to Pref<T>, but does not immediately store written data in persistent storage. Instead, writes with a delay, which depends on whether the data stabilized or keeps changing.
Depends on the "dejwk/roo_scheduler" library.
| using roo_prefs::Bool = typedef Pref<bool> |
| using roo_prefs::Double = typedef Pref<double> |
| using roo_prefs::Float = typedef Pref<float> |
| using roo_prefs::Int16 = typedef Pref<int16_t> |
| using roo_prefs::Int32 = typedef Pref<int32_t> |
| using roo_prefs::Int64 = typedef Pref<int64_t> |
| using roo_prefs::Int8 = typedef Pref<int8_t> |
| using roo_prefs::LazyBool = typedef LazyWritePref<bool> |
Definition at line 48 of file lazy_write_pref.h.
| using roo_prefs::LazyDouble = typedef LazyWritePref<double> |
Definition at line 58 of file lazy_write_pref.h.
| using roo_prefs::LazyFloat = typedef LazyWritePref<float> |
Definition at line 57 of file lazy_write_pref.h.
| using roo_prefs::LazyInt16 = typedef LazyWritePref<int16_t> |
Definition at line 52 of file lazy_write_pref.h.
| using roo_prefs::LazyInt32 = typedef LazyWritePref<int32_t> |
Definition at line 54 of file lazy_write_pref.h.
| using roo_prefs::LazyInt64 = typedef LazyWritePref<int64_t> |
Definition at line 56 of file lazy_write_pref.h.
| using roo_prefs::LazyInt8 = typedef LazyWritePref<int8_t> |
Definition at line 50 of file lazy_write_pref.h.
| using roo_prefs::LazyUint16 = typedef LazyWritePref<uint16_t> |
Definition at line 51 of file lazy_write_pref.h.
| using roo_prefs::LazyUint32 = typedef LazyWritePref<uint32_t> |
Definition at line 53 of file lazy_write_pref.h.
| using roo_prefs::LazyUint64 = typedef LazyWritePref<uint64_t> |
Definition at line 55 of file lazy_write_pref.h.
| using roo_prefs::LazyUint8 = typedef LazyWritePref<uint8_t> |
Definition at line 49 of file lazy_write_pref.h.
| using roo_prefs::Store = typedef PreferencesStore |
Definition at line 10 of file collection.h.
| using roo_prefs::String = typedef Pref<std::string> |
| using roo_prefs::Uint16 = typedef Pref<uint16_t> |
| using roo_prefs::Uint32 = typedef Pref<uint32_t> |
| using roo_prefs::Uint64 = typedef Pref<uint64_t> |
| using roo_prefs::Uint8 = typedef Pref<uint8_t> |
|
strong |
|
strong |
|
strong |
| const char * roo_prefs::ClearResultToString | ( | ClearResult | result | ) |
| roo_logging::Stream & roo_prefs::operator<< | ( | roo_logging::Stream & | os, |
| ClearResult | result | ||
| ) |
Definition at line 47 of file status.cpp.
References ClearResultToString().
| roo_logging::Stream & roo_prefs::operator<< | ( | roo_logging::Stream & | os, |
| ReadResult | result | ||
| ) |
Definition at line 39 of file status.cpp.
References ReadResultToString().
| roo_logging::Stream & roo_prefs::operator<< | ( | roo_logging::Stream & | os, |
| WriteResult | result | ||
| ) |
Definition at line 43 of file status.cpp.
References WriteResultToString().
| const char * roo_prefs::ReadResultToString | ( | ReadResult | result | ) |
Definition at line 5 of file status.cpp.
References kError, kNotFound, kOk, and kWrongType.
Referenced by operator<<().
| const char * roo_prefs::WriteResultToString | ( | WriteResult | result | ) |
|
constexpr |
ClearResult::kError instead.
|
constexpr |
ClearResult::kOk instead.
|
constexpr |
ReadResult::kError instead.
|
constexpr |
ReadResult::kNotFound instead.
|
constexpr |
ReadResult::kOk instead.
|
constexpr |
ReadResult::kWrongType instead.
|
constexpr |
WriteResult::kError instead.
|
constexpr |
WriteResult::kOk instead.