|
dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
|
kernel-mode promoted value, mirroring dx::promoted's server/commit/notify shape More...
#include <dxd_promoted.h>
Public Types | |
| typedef lock< mutex > | lock_t |
Public Member Functions | |
| void | commit (lock_t &&lock, const value_t &value) |
| server calls this once it has decided on(and, if needed, persisted) the actual value to accept - wakes every registered listener. | |
| operator const value_t & () | |
| promoted & | operator++ () |
| value_t | operator++ (int) |
| promoted & | operator+= (const value_t &delta) |
| a counted value steps under the lock: concurrent steps never lose one, a step below zero stops at it, the postfix forms return what they stepped from | |
| promoted & | operator-- () |
| value_t | operator-- (int) |
| promoted & | operator-= (const value_t &delta) |
| promoted & | operator= (const value_t &value) |
| promoted (const value_t &value, server_t &&server) | |
| promoted (server_t &&server) | |
Public Attributes | |
| broadcast | broadcast |
| listeners (dxd::event<dxd::kernel|dxd::user>) woken on every commit() | |
| bool | initialized {} |
| indicates the value has been initialized | |
| bool | transient {} |
| indicates the value is in transition - does not have the new value yet | |
Protected Member Functions | |
| promoted & | set (lock< mutex > &&lock, const value_t &value) |
| every write funnels through here: the server decides under the lock handed over; a write in flight makes it a no-op rather than a throw | |
Protected Attributes | |
| os_result | status |
kernel-mode promoted value, mirroring dx::promoted's server/commit/notify shape
Same concept as dx::promoted(dx_value.h): a value that funnels every write through a pluggable server callback(validate/align/persist, then commit()), caches the committed value for reads, and notifies interested parties of every change - without dx::promoted's std::mutex/std::function/dx::listen, none of which are kernel-safe.
Two differences in kind, both forced by the kernel environment rather than a narrowing of the concept:
No C++ exceptions (kernel code doesn't use them - see dxd/CLAUDE.md): the server callback is expected to call commit() itself when a value is accepted, exactly like dx::promoted's server contract already documents; a server that declines a change simply doesn't call commit(), leaving the previous value in place - there is no thrown rejection to report back to operator=()'s caller. Reentrancy (writing while a write is already in flight) is defended against by no-op'ing rather than throwing.
| typedef lock<mutex> dxd::promoted< value_t, server_t >::lock_t |
|
inline |
|
inline |
|
inline |
server calls this once it has decided on(and, if needed, persisted) the actual value to accept - wakes every registered listener.
|
inline |
|
inline |
|
inline |
|
inline |
a counted value steps under the lock: concurrent steps never lose one, a step below zero stops at it, the postfix forms return what they stepped from
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
every write funnels through here: the server decides under the lock handed over; a write in flight makes it a no-op rather than a throw
| broadcast dxd::promoted< value_t, server_t >::broadcast |
listeners (dxd::event<dxd::kernel|dxd::user>) woken on every commit()
| bool dxd::promoted< value_t, server_t >::initialized {} |
indicates the value has been initialized
|
inherited |
| bool dxd::promoted< value_t, server_t >::transient {} |
indicates the value is in transition - does not have the new value yet
| (c) copyright 2009 dynamic acoustics e.U. | generated on |