dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
cf::_preference Class Reference

persistant storarage base class - do not use directly! use cf::preference More...

#include <cf_preference.h>

Inheritance diagram for cf::_preference:
Collaboration diagram for cf::_preference:

Classes

struct  property

Public Member Functions

 _preference(::CFStringRef application= ::kCFPreferencesCurrentApplication, ::CFStringRef user= ::kCFPreferencesCurrentUser, ::CFStringRef host= ::kCFPreferencesAnyHost)
 _preference(const char* application)
 catch(...)
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.
size_t size() const
 self's own immediate child count.
void synchronize() noexcept

Static Public Member Functions

static void assign(const self_t& self, const value_t& value)
static void assign_property(const self_t& self, ::CFPropertyListRef value, ::CFPropertyListRef baseline= nullptr)
static container_t children(const self_t& self)
static constexpr bool enabled()
static bool fetch(const self_t& self, value_t& value)
static bool nested(const self_t& self)
static ::CFPropertyListRef property_list(const self_t& self)
static void purge(const self_t& self) noexcept
static size_t size(const self_t& self)

Public Attributes

std::string key

Protected Member Functions

 _preference(const _preference& preferencepreference, const std::string& key)
bool container() const
void erase() noexcept
 operator array<>::dx_container() const
 operator bool() const noexcept
::CFPropertyListRef operator ()(::CFPropertyListRef dflt) const
 operator ::CFArrayRef() const
 +1: this key's own dictionary keys, or (key empty) the whole domain's top-level keys.
 operator ::CFPropertyListRef() const
void operator =(::CFPropertyListRef value)
void operator =(const _preference& preferencepreference) noexcept
 ~_preference()

Friends

class tree<_preference>

Detailed Description

persistant storarage base class - do not use directly! use cf::preference

Implements cf::tree's 10 position-only primitives (cf_tree.h) over CFPreferences - operating on this key alone (application/user/host, one bare CFPreferences key, 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.

Constructor & Destructor Documentation

◆ _preference() [1/3]

cf::_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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~_preference()

cf::_preference::~_preference()
inlineprotected
Here is the call graph for this function:

◆ _preference() [2/3]

cf::_preference::_preference(::CFStringRef application= ::kCFPreferencesCurrentApplication, ::CFStringRef user= ::kCFPreferencesCurrentUser, ::CFStringRef host= ::kCFPreferencesAnyHost)
inline

◆ _preference() [3/3]

cf::_preference::_preference(const char* application)
inline
Here is the call graph for this function:

Member Function Documentation

◆ assign()

void cf::tree<_preference>::assign(const self_t& self, const value_t& value)
inlinestaticinherited

◆ 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()

cf::tree<_preference>::catch(...)
inlineinherited

◆ children()

container_t cf::tree<_preference>::children(const self_t& self)
inlinestaticinherited

◆ container()

bool cf::_preference::container() const
inlineprotected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enabled()

constexpr bool cf::tree<_preference>::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 cf::_preference::erase()
inlineprotectednoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fetch()

bool cf::tree<_preference>::fetch(const self_t& self, value_t& value)
inlinestaticinherited

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.

◆ nested()

bool cf::tree<_preference>::nested(const self_t& self)
inlinestaticinherited

◆ operator array<>::dx_container()

cf::_preference::operator array<>::dx_container() const
inlineprotected

same enumeration as operator ::CFArrayRef(), as the friendlier vector-of-cf::type<> container.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator bool()

cf::_preference::operator bool() const
inlineprotectednoexcept

◆ operator container_t()

template<typename container_t, typename= typename std::enable_if< dx::is_string_container_v<container_t>, container_t>::type>
cf::_preference::operator container_t() const
inline

position-only: self's own child names, as any string container.

◆ operator ()()

::CFPropertyListRef cf::_preference::operator ()(::CFPropertyListRef dflt) const
inlineprotected
Here is the call graph for this function:

◆ operator ::CFArrayRef()

cf::_preference::operator ::CFArrayRef() const
inlineprotected

+1: this key's own dictionary keys, or (key empty) the whole domain's top-level keys.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator ::CFPropertyListRef()

cf::_preference::operator ::CFPropertyListRef() const
inlineprotected

position-only: this key alone (empty means the whole domain) - +1, never sees the parent chain (see contract note above).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator =() [1/2]

void cf::_preference::operator =(::CFPropertyListRef value)
inlineprotected
Here is the call graph for this function:

◆ operator =() [2/2]

void cf::_preference::operator =(const _preference& preference)
inlineprotectednoexcept
Here is the call graph for this function:

◆ property_list()

::CFPropertyListRef cf::tree<_preference>::property_list(const self_t& self)
inlinestaticinherited
Here is the caller graph for this function:

◆ purge()

void cf::tree<_preference>::purge(const self_t& self)
inlinestaticnoexceptinherited

◆ size() [1/2]

size_t cf::_preference::size() const
inline

self's own immediate child count.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ size() [2/2]

size_t cf::tree<_preference>::size(const self_t& self)
inlinestaticinherited

◆ synchronize()

void cf::_preference::synchronize()
inlinenoexcept
Here is the caller graph for this function:

◆ tree<_preference>

friend class tree<_preference>
friend

Member Data Documentation

◆ key

std::string cf::_preference::key

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