dxd - dynax driver framework 2.5.0d148
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::promoted< value_t >::preference< preference_t, preference_value_t > Class Template Reference

promoted::preference with default and optional alignment function More...

#include <dx_value.h>

+ Inheritance diagram for dx::promoted< value_t >::preference< preference_t, preference_value_t >:
+ Collaboration diagram for dx::promoted< value_t >::preference< preference_t, preference_value_t >:

Public Types

typedef std::unique_lock< mutex_tlock_t
 
typedef std::mutex mutex_t
 

Public Member Functions

 catch (...)
 
 catch (...)
 
 catch (...)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
 catch (const std::exception &__std_exception)
 
void commit (lock_t &lock, const value_t &value) try
 
 operator const value_t & () try
 
bool operator== (const value_t &value) noexcept
 
 preference (const preference_t &preference, const decltype(dflt)&dflt=[]() ->value_t{return {};}, const decltype(align)&align=[](value_t value){return value;})
 

Public Attributes

std::function< value_t(value_t)> align
 
std::function< value_t()> dflt
 
bool initialized {}
 
std::deque< std::function< void(const value_t &)> listen )
 
std::function< void(lock_t &, const value_t &) server ) {}
 \ indicate the value is in transition - does not have the new value yet
 
bool transient {}
 \ indicate the value has been initialized
 

Protected Attributes

value_t value
 

Detailed Description

template<typename value_t>
template<typename preference_t, typename preference_value_t>
class dx::promoted< value_t >::preference< preference_t, preference_value_t >

promoted::preference with default and optional alignment function

A promoted preference value

Todo
promoted::preference: consider moving default and alignment into key_value_pair<preference>

Member Typedef Documentation

◆ lock_t

template<typename value_t >
typedef std::unique_lock<mutex_t> dx::promoted< value_t >::lock_t
inherited

◆ mutex_t

template<typename value_t >
typedef std::mutex dx::promoted< value_t >::mutex_t
inherited

Constructor & Destructor Documentation

◆ preference()

template<typename value_t >
template<typename preference_t , typename preference_value_t >
dx::promoted< value_t >::preference< preference_t, preference_value_t >::preference ( const preference_t & preference,
const decltype(dflt)& dflt = []()->value_t{return {};},
const decltype(align)& align = [](value_t value){return value;} )
inline

Member Function Documentation

◆ catch() [1/9]

template<typename value_t >
dx::promoted< value_t >::catch ( ...)
inlineinherited

◆ catch() [2/9]

template<typename value_t >
dx::promoted< value_t >::catch ( ...)
inlineinherited

◆ catch() [3/9]

template<typename value_t >
dx::promoted< value_t >::catch ( ...)
inlineinherited

◆ catch() [4/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const dx::exception & __dx_exception)
inlineinherited

◆ catch() [5/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const dx::exception & __dx_exception)
inlineinherited

◆ catch() [6/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const dx::exception & __dx_exception)
inlineinherited

◆ catch() [7/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const std::exception & __std_exception)
inlineinherited

◆ catch() [8/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const std::exception & __std_exception)
inlineinherited

◆ catch() [9/9]

template<typename value_t >
dx::promoted< value_t >::catch ( const std::exception & __std_exception)
inlineinherited

◆ commit()

template<typename value_t >
void dx::promoted< value_t >::commit ( lock_t & lock,
const value_t & value )
inlineinherited
+ Here is the caller graph for this function:

◆ operator const value_t &()

template<typename value_t >
dx::promoted< value_t >::operator const value_t & ( )
inlineinherited

◆ operator==()

template<typename value_t >
bool dx::promoted< value_t >::operator== ( const value_t & value)
inlinenoexceptinherited

Member Data Documentation

◆ align

template<typename value_t >
template<typename preference_t , typename preference_value_t >
std::function<value_t(value_t)> dx::promoted< value_t >::preference< preference_t, preference_value_t >::align

◆ dflt

template<typename value_t >
template<typename preference_t , typename preference_value_t >
std::function<value_t()> dx::promoted< value_t >::preference< preference_t, preference_value_t >::dflt

◆ initialized

template<typename value_t >
bool dx::promoted< value_t >::initialized {}
inherited

◆ listen

template<typename value_t >
std::deque<std::function<void(const value_t&)> dx::promoted< value_t >::listen)
inherited

◆ server

template<typename value_t >
std::function<void(lock_t&, const value_t&) dx::promoted< value_t >::server) {}
inherited

\ indicate the value is in transition - does not have the new value yet

server: handle synchronous and asynchronous value updates and initialization it needs to handle these case: not initialized and not in transation: initialze and commit the value not initialized and in transation: if dependent on external settings initialize a temporary and compare it with the new value and update the external setting if required make sure to commit the new value so listeners get notified either synchronously or asynchronously by external notification initialized and in transition: update external settings if any and make sure to commit the new value so listeners get notified either synchronously or asynchronousl by external notification

server will not be called with this state: initialized and not in transation

◆ transient

template<typename value_t >
bool dx::promoted< value_t >::transient {}
inherited

\ indicate the value has been initialized

◆ value

template<typename value_t >
value_t dx::promoted< value_t >::value
protectedinherited

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

(c) copyright 2009 dynamic acoustics e.U. generated on Fri Aug 22 2025

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.