Scope
|
#include <ScopeValueBase.h>
Inherited by scope::ScopeNumber< T > [virtual]
, scope::ScopeString [virtual]
, scope::ScopeValue< T > [virtual]
, scope::ScopeNumber< bool > [virtual]
, scope::ScopeNumber< double > [virtual]
, scope::ScopeNumber< scope::ScopeDatatypeBase > [virtual]
, scope::ScopeNumber< uint32_t > [virtual]
, scope::ScopeNumber< uint8_t > [virtual]
, scope::ScopeNumber< ValT > [virtual]
, scope::ScopeValue< bool > [virtual]
, scope::ScopeValue< double > [virtual]
, scope::ScopeValue< scope::ScopeDatatypeBase > [virtual]
, scope::ScopeValue< ScopeDatatypeBase< ZDeviceHelper > > [virtual]
, scope::ScopeValue< std::wstring > [virtual]
, scope::ScopeValue< uint32_t > [virtual]
, scope::ScopeValue< uint8_t > [virtual]
, and scope::ScopeValue< ValT > [virtual]
.
Public Member Functions | |
ScopeValueBase (const std::wstring &_name=L"None") | |
ScopeValueBase (const ScopeValueBase &_svb) | |
ScopeValueBase & | operator= (const ScopeValueBase &_svb) |
virtual | ~ScopeValueBase () |
std::wstring | Name () const |
void | SetName (const std::wstring &_name) |
void | SetRWState (const bool &_state) |
bool | GetRWState () const |
boost::signals2::connection | ConnectGUI (signalchange_t::slot_type slot) |
boost::signals2::connection | ConnectOther (signalchange_t::slot_type slot) |
boost::signals2::connection | ConnectState (signalstate_t::slot_type slot) |
Protected Types | |
typedef boost::signals2::signal< void()> | signalchange_t |
typedef boost::signals2::signal< void(bool)> | signalstate_t |
Protected Attributes | |
std::wstring | name |
std::mutex | mutex |
bool | readwrite |
signalchange_t | changesiggui |
signalchange_t | changesigother |
signalstate_t | statesig |
Base class for a thread-safe value, with signals that are called on value changes.
It uses a mutex to protect the value and boost::signals2 to call connected function.
Definition at line 7 of file ScopeValueBase.h.
|
protected |
typedef for change signal slot functions
Definition at line 20 of file ScopeValueBase.h.
|
protected |
typedef for state signal slot functions
Definition at line 23 of file ScopeValueBase.h.
|
inline |
Initialize name and readonly.
Definition at line 36 of file ScopeValueBase.h.
|
inline |
|
inlinevirtual |
Disconnects all slots from signals.
Definition at line 59 of file ScopeValueBase.h.
|
inline |
|
inline |
Definition at line 68 of file ScopeValueBase.h.
|
inline |
Set the name.
Definition at line 74 of file ScopeValueBase.h.
|
inline |
Sets readonly/read-write state.
True = read&write, false = readonly.
Definition at line 80 of file ScopeValueBase.h.
|
inline |
Definition at line 89 of file ScopeValueBase.h.
|
inline |
Connect signal to slot to GUI.
Save the connection object and call its disconnect to disconnect.
Definition at line 95 of file ScopeValueBase.h.
|
inline |
Connect signal to slot to other stuff.
Save the connection object and call its disconnect to disconnect.
Definition at line 101 of file ScopeValueBase.h.
|
inline |
Connect signal to slot for state changes.
Save the connection object and call its disconnect to disconnect.
Definition at line 106 of file ScopeValueBase.h.
|
protected |
the name of the value
Definition at line 11 of file ScopeValueBase.h.
|
mutableprotected |
a mutex for protection.
Is mutable so we can have accessor functions as const!
Definition at line 14 of file ScopeValueBase.h.
|
protected |
read-write state, true if read&write, false if onyl read (not an atomic, since access to the data variable has to be protected while we change readonly)
Definition at line 17 of file ScopeValueBase.h.
|
protected |
signal that is called for GUI on value changes
Definition at line 26 of file ScopeValueBase.h.
|
protected |
signal that is called for other stuff on value changes
Definition at line 29 of file ScopeValueBase.h.
|
protected |
signal that is called on changes of read/write status
Definition at line 32 of file ScopeValueBase.h.