50 if (
this != &_svb ) {
51 std::lock_guard<std::mutex> lock(mutex);
60 std::lock_guard<std::mutex> lock(mutex);
62 changesiggui.disconnect_all_slots();
63 changesigother.disconnect_all_slots();
64 statesig.disconnect_all_slots();
68 std::wstring
Name()
const {
69 std::lock_guard<std::mutex> lock(mutex);
75 std::lock_guard<std::mutex> lock(mutex);
82 std::lock_guard<std::mutex> lock(mutex);
90 std::lock_guard<std::mutex> lock(mutex);
95 boost::signals2::connection
ConnectGUI(signalchange_t::slot_type slot) {
97 return changesiggui.connect(slot);
101 boost::signals2::connection
ConnectOther(signalchange_t::slot_type slot) {
102 return changesigother.connect(slot);
106 boost::signals2::connection
ConnectState(signalstate_t::slot_type slot) {
107 return statesig.connect(slot);
std::wstring Name() const
boost::signals2::connection ConnectGUI(signalchange_t::slot_type slot)
Connect signal to slot to GUI.
signalchange_t changesigother
signal that is called for other stuff on value changes
std::wstring name
the name of the value
void SetName(const std::wstring &_name)
Set the name.
ScopeValueBase(const ScopeValueBase &_svb)
Safe copy.
ScopeValueBase & operator=(const ScopeValueBase &_svb)
Safe assignment.
ScopeValueBase(const std::wstring &_name=L"None")
Initialize name and readonly.
virtual ~ScopeValueBase()
Disconnects all slots from signals.
std::mutex mutex
a mutex for protection.
boost::signals2::signal< void()> signalchange_t
typedef for change signal slot functions
signalstate_t statesig
signal that is called on changes of read/write status
bool readwrite
read-write state, true if read&write, false if onyl read (not an atomic, since access to the data var...
boost::signals2::connection ConnectState(signalstate_t::slot_type slot)
Connect signal to slot for state changes.
boost::signals2::signal< void(bool)> signalstate_t
typedef for state signal slot functions
signalchange_t changesiggui
signal that is called for GUI on value changes
void SetRWState(const bool &_state)
Sets readonly/read-write state.
boost::signals2::connection ConnectOther(signalchange_t::slot_type slot)
Connect signal to slot to other stuff.
Base class for a thread-safe value, with signals that are called on value changes.