persistant system configuration storarage base class - do not use directly! use sc::preference
More...
#include <sc_preference.h>
|
| class | lock |
| | the system configuration store's write lock, held for the scope - a store several processes write needs it around a change More...
|
|
| | _preference (::CFStringRef id, ::CFRunLoopRef runloop, ::CFStringRef key=nullptr) |
| | _preference (::CFStringRef id, ::CFStringRef key=nullptr) |
| _preference & | apply () |
| | catch (...) |
| _preference & | commit () |
| | commit changes to persistent storage. Needs to have root access rights
|
| ::CFIndex | count () const noexcept |
| reference & | initialize (::SCPreferencesRef cf_object, bool retain=true) |
| void | initialize (::CFStringRef id, ::CFRunLoopRef runloop, ::CFStringRef key=nullptr) |
| void | initialize (::CFStringRef id, ::CFStringRef key=nullptr) |
| template<typename container_t, typename = typename std::enable_if< dx::is_string_container_v<container_t>, container_t>::type> |
| | operator container_t () const |
| | position-only: self's own child names, as any string container.
|
| | operator type<> () const noexcept |
| bool | operator!= (::SCPreferencesRef cf_object) const noexcept |
| | operator::CFTypeID () const noexcept |
| | operator::CFTypeRef () const noexcept |
| | operator::SCPreferencesRef () const noexcept |
| | operator::SCPreferencesRef () const noexcept |
| virtual bool | operator== (::CFTypeID cf_type) const noexcept |
| bool | operator== (::SCPreferencesRef cf_object) const noexcept |
| void | release () noexcept |
| const reference & | retain () const noexcept |
| size_t | size () const |
| | self's own immediate child count.
|
| _preference & | synchronize () noexcept |
|
| std::vector< std::function< void(::SCPreferencesNotification type)> > | interest |
| std::string | key |
persistant system configuration storarage base class - do not use directly! use sc::preference
Implements cf::tree's 10 position-only primitives (cf_tree.h) over SCPreferences - operating on this key alone (empty meaning the whole domain), never the parent chain. cf::tree supplies the dx::key_value_tree< _preference> contract (fetch/assign/purge/nested) on top, by recursing through those primitives up to the true root.
◆ _preference() [1/3]
| sc::_preference::_preference |
( |
const _preference & | preference, |
|
|
const std::string & | key ) |
|
inlineprotected |
cheap: no I/O at all, just extends identity with a bare child name - this is what dx::key_value_tree::operator[] builds on.
◆ ~_preference()
| sc::_preference::~_preference |
( |
| ) |
|
|
inlineoverrideprotected |
◆ _preference() [2/3]
| sc::_preference::_preference |
( |
::CFStringRef | id, |
|
|
::CFStringRef | key = nullptr ) |
|
inline |
◆ _preference() [3/3]
| sc::_preference::_preference |
( |
::CFStringRef | id, |
|
|
::CFRunLoopRef | runloop, |
|
|
::CFStringRef | key = nullptr ) |
|
inline |
◆ apply()
◆ assign()
◆ assign_property()
| void cf::tree< _preference >::assign_property |
( |
const self_t & | self, |
|
|
::CFPropertyListRef | value, |
|
|
::CFPropertyListRef | baseline = nullptr ) |
|
inlinestaticinherited |
downward write-back mirroring property_list()'s upward read, creating ancestor dictionaries as needed. baseline is the parent value this write's own value was computed from (passed down from the caller's own property_list() read) - at the root, a mismatch against the current stored value means a concurrent writer raced this one, and dx::busy is raised so assign()/purge() retry against fresh state.
◆ catch()
◆ children()
◆ commit()
commit changes to persistent storage. Needs to have root access rights
- Todo
- sc::preference: hack commit/apply: exchange dx_assert with dx_pass again
◆ container()
| bool sc::_preference::container |
( |
| ) |
const |
|
inlineprotected |
◆ count()
◆ enabled()
|
|
inlinestaticconstexprinherited |
mirrors fetch<>'s supported value_t set, for key_value_tree_enabled's SFINAE (dx_key_value_tree.h) - cf's own POD/bridging or CFPropertyListRef-constructible types only.
◆ erase()
| void sc::_preference::erase |
( |
| ) |
|
|
inlineprotectednoexcept |
◆ fetch()
value_t is a cf POD/bridging type (see enabled() below) or a foreign type convertible from a CF pointer (e.g. cf::dictionary<>, routed via the third branch below); returns false for an absent self, throwing only for a genuinely malformed stored value.
◆ initialize() [1/3]
◆ initialize() [2/3]
| void sc::_preference::initialize |
( |
::CFStringRef | id, |
|
|
::CFRunLoopRef | runloop, |
|
|
::CFStringRef | key = nullptr ) |
|
inline |
◆ initialize() [3/3]
| void sc::_preference::initialize |
( |
::CFStringRef | id, |
|
|
::CFStringRef | key = nullptr ) |
|
inline |
◆ nested()
◆ notify()
| virtual void sc::_preference::notify |
( |
::SCPreferencesNotification | type | ) |
|
|
inlineprotectedvirtual |
◆ operator bool()
| sc::_preference::operator bool |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ operator cf::array<>::dx_container()
| sc::_preference::operator cf::array<>::dx_container |
( |
| ) |
const |
|
inlineprotected |
same enumeration as operator ::CFArrayRef(), as the friendlier vector-of-cf::type<> container.
◆ operator container_t()
template<typename container_t, typename = typename std::enable_if< dx::is_string_container_v<container_t>, container_t>::type>
| sc::_preference::operator container_t |
( |
| ) |
const |
|
inline |
position-only: self's own child names, as any string container.
◆ operator type<>()
◆ operator!=()
◆ operator()()
◆ operator::CFArrayRef()
| sc::_preference::operator::CFArrayRef |
( |
| ) |
const |
|
inlineprotected |
◆ operator::CFPropertyListRef()
| sc::_preference::operator::CFPropertyListRef |
( |
| ) |
const |
|
inlineprotected |
◆ operator::CFTypeID()
|
|
inlineexplicitnoexceptinherited |
◆ operator::CFTypeRef()
◆ operator::SCPreferencesRef() [1/2]
| cf::reference< ::SCPreferencesRef >::operator ::SCPreferencesRef |
( |
| ) |
const |
|
inlinenoexceptinherited |
◆ operator::SCPreferencesRef() [2/2]
| cf::reference< ::SCPreferencesRef >::operator ::SCPreferencesRef |
( |
| ) |
const |
|
inlinenoexceptinherited |
◆ operator=() [1/2]
◆ operator=() [2/2]
| void sc::_preference::operator= |
( |
const _preference & | preference | ) |
|
|
inlineprotected |
◆ operator==() [1/2]
|
|
inlinevirtualnoexceptinherited |
◆ operator==() [2/2]
◆ property_list()
◆ purge()
|
|
inlinestaticnoexceptinherited |
◆ release()
| void sc::_preference::release |
( |
| ) |
|
|
inlinenoexcept |
◆ retain()
◆ size() [1/2]
◆ size() [2/2]
| size_t sc::_preference::size |
( |
| ) |
const |
|
inline |
self's own immediate child count.
◆ synchronize()
◆ cf::tree< _preference >
◆ cf_object
◆ id
◆ interest
| std::vector<std::function <void(::SCPreferencesNotification type)> > sc::_preference::interest |
◆ key
| std::string sc::_preference::key |
The documentation for this class was generated from the following file: