dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::service::client::promoted< value_t, request_t, server_value_t > Class Template Reference

a host's promoted mirrored, born with the pipe as its server (dx_value.h: no promoted is born empty): a wish (assignment) or a question (first access) goes to the host as data, the promoted commits the host's answer under its own lock; a message outside a request is the host's broadcast, committed on the pipe's thread under the promoted's lock More...

#include <dx_service_client_driver.h>

Inheritance diagram for dx::service::client::promoted< value_t, request_t, server_value_t >:
Collaboration diagram for dx::service::client::promoted< value_t, request_t, server_value_t >:

Public Types

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

Public Member Functions

void commit (lock_t &&lock, const value_t &value)
 operator const value_t & ()
promotedoperator++ () noexcept
value_t operator++ (int) noexcept
promotedoperator+= (const value_t &value) noexcept
promotedoperator-- () noexcept
value_t operator-- (int) noexcept
promotedoperator-= (const value_t &value) noexcept
const value_toperator-> ()
bool operator== (const value_t &value)
bool operator== (promoted &promoted) noexcept
 promoted (dx::pipe< request_t > &pipe, enum class request_t::id id)

Public Attributes

bool initialized
listen< std::function< void(const value_t &)> > listen
std::function< void(lock_t &&, const value_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, typename request_t, typename server_value_t = value_t>
class dx::service::client::promoted< value_t, request_t, server_value_t >

a host's promoted mirrored, born with the pipe as its server (dx_value.h: no promoted is born empty): a wish (assignment) or a question (first access) goes to the host as data, the promoted commits the host's answer under its own lock; a message outside a request is the host's broadcast, committed on the pipe's thread under the promoted's lock

Member Typedef Documentation

◆ lock_t

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

◆ mutex_t

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

◆ value_t

typedef value_t dx::promoted< value_t >::value_t
inherited

Constructor & Destructor Documentation

◆ promoted()

template<typename value_t, typename request_t, typename server_value_t = value_t>
dx::service::client::promoted< value_t, request_t, server_value_t >::promoted ( dx::pipe< request_t > & pipe,
enum class request_t::id id )
inline
Here is the call graph for this function:

Member Function Documentation

◆ commit()

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

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

◆ operator++() [1/2]

promoted & dx::promoted< value_t >::operator++ ( )
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator++() [2/2]

value_t dx::promoted< value_t >::operator++ ( int )
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator+=()

promoted & dx::promoted< value_t >::operator+= ( const value_t & value)
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator--() [1/2]

promoted & dx::promoted< value_t >::operator-- ( )
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator--() [2/2]

value_t dx::promoted< value_t >::operator-- ( int )
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator-=()

promoted & dx::promoted< value_t >::operator-= ( const value_t & value)
inlinenoexceptinherited
Here is the call graph for this function:

◆ operator->()

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

◆ operator==() [1/2]

bool dx::promoted< value_t >::operator== ( const value_t & value)
inlineinherited

◆ operator==() [2/2]

bool dx::promoted< value_t >::operator== ( promoted< value_t > & promoted)
inlinenoexceptinherited
Here is the call graph for this function:

Member Data Documentation

◆ initialized

bool dx::promoted< value_t >::initialized
inherited

◆ listen

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

◆ server

std::function<void(lock_t&&, const value_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 lock: lock promoted value from access during update value: new value (if in transition) current: current value to allow discarding update and reverting to current value if update is not permitted

it needs to handle these case: not initialized and not in transition: initialze and commit the value not initialized and in transition: 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

for synchronous operation: move lock to commit for asynchronous operation: store lock and at asynchronous response restore and move lock to commit

◆ transient

bool dx::promoted< value_t >::transient
inherited

\ indicate the value has been initialized

◆ value

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

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.