dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
sc::_preference Class Reference

persistant system configuration storarage base class - do not use directly! use sc::preference More...

#include <sc_preference.h>

Inheritance diagram for sc::_preference:
Collaboration diagram for sc::_preference:

Classes

class  lock
 the system configuration store's write lock, held for the scope - a store several processes write needs it around a change More...

Public Member Functions

 _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

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::vector< std::function< void(::SCPreferencesNotification type)> > interest
std::string key

Protected Member Functions

 _preference (const _preference &preference, const std::string &key)
bool container () const
void erase () noexcept
virtual void notify (::SCPreferencesNotification type)
 operator bool () const override
 operator cf::array<>::dx_container () const
::CFPropertyListRef operator() (::CFPropertyListRef dflt) const noexcept
 operator::CFArrayRef () const
 operator::CFPropertyListRef () const
void operator= (::CFPropertyListRef value)
void operator= (const _preference &preference)
 ~_preference () override

Protected Attributes

::SCPreferencesRef cf_object
cf::string id

Friends

class cf::tree< _preference >

Detailed Description

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.

Constructor & Destructor Documentation

◆ _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.

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

◆ ~_preference()

sc::_preference::~_preference ( )
inlineoverrideprotected
Here is the call graph for this function:

◆ _preference() [2/3]

sc::_preference::_preference ( ::CFStringRef id,
::CFStringRef key = nullptr )
inline
Here is the call graph for this function:

◆ _preference() [3/3]

sc::_preference::_preference ( ::CFStringRef id,
::CFRunLoopRef runloop,
::CFStringRef key = nullptr )
inline
Here is the call graph for this function:

Member Function Documentation

◆ apply()

_preference & sc::_preference::apply ( )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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

◆ commit()

_preference & sc::_preference::commit ( )
inline

commit changes to persistent storage. Needs to have root access rights

Todo
sc::preference: hack commit/apply: exchange dx_assert with dx_pass again
Here is the call graph for this function:
Here is the caller graph for this function:

◆ container()

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

◆ count()

::CFIndex cf::reference< ::SCPreferencesRef >::count ( ) const
inlinenoexceptinherited

◆ 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 sc::_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.

◆ initialize() [1/3]

reference & cf::reference< ::SCPreferencesRef >::initialize ( ::SCPreferencesRef cf_object,
bool retain = true )
inlineinherited

◆ initialize() [2/3]

void sc::_preference::initialize ( ::CFStringRef id,
::CFRunLoopRef runloop,
::CFStringRef key = nullptr )
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize() [3/3]

void sc::_preference::initialize ( ::CFStringRef id,
::CFStringRef key = nullptr )
inline
Here is the call graph for this function:

◆ nested()

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

◆ notify()

virtual void sc::_preference::notify ( ::SCPreferencesNotification type)
inlineprotectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

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

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

cf::reference< ::SCPreferencesRef >::operator type<> ( ) const
noexceptinherited

◆ operator!=()

bool cf::reference< ::SCPreferencesRef >::operator!= ( ::SCPreferencesRef cf_object) const
inlinenoexceptinherited

◆ operator()()

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

◆ operator::CFArrayRef()

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

◆ operator::CFPropertyListRef()

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

◆ operator::CFTypeID()

cf::reference< ::SCPreferencesRef >::operator::CFTypeID ( ) const
inlineexplicitnoexceptinherited

◆ operator::CFTypeRef()

cf::reference< ::SCPreferencesRef >::operator::CFTypeRef ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::SCPreferencesRef() [1/2]

cf::reference< ::SCPreferencesRef >::operator ::SCPreferencesRef ( ) const
inlinenoexceptinherited
Here is the caller graph for this function:

◆ operator::SCPreferencesRef() [2/2]

cf::reference< ::SCPreferencesRef >::operator ::SCPreferencesRef ( ) const
inlinenoexceptinherited

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==() [1/2]

virtual bool cf::reference< ::SCPreferencesRef >::operator== ( ::CFTypeID cf_type) const
inlinevirtualnoexceptinherited

◆ operator==() [2/2]

bool cf::reference< ::SCPreferencesRef >::operator== ( ::SCPreferencesRef cf_object) const
inlinenoexceptinherited

◆ 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

◆ release()

void sc::_preference::release ( )
inlinenoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retain()

const reference & cf::reference< ::SCPreferencesRef >::retain ( ) const
inlinenoexceptinherited

◆ size() [1/2]

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

◆ size() [2/2]

size_t sc::_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:

◆ synchronize()

_preference & sc::_preference::synchronize ( )
inlinenoexcept
Here is the call graph for this function:

◆ cf::tree< _preference >

friend class cf::tree< _preference >
friend

Member Data Documentation

◆ cf_object

::SCPreferencesRef cf::reference< ::SCPreferencesRef >::cf_object
protectedinherited

◆ id

cf::string sc::_preference::id
protected

◆ 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:

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.