Scope
|
#include <ScopeNumber.h>
Inherits scope::ScopeValue< T >, and scope::ScopeValueBase.
Public Member Functions | |
ScopeNumber (const T &_v=0, const T &_ll=0, const T &_ul=0, const std::wstring &_name=L"None") | |
ScopeNumber (const ScopeNumber< T > &orig) | |
ScopeNumber & | operator= (const ScopeNumber< T > &v) |
ScopeNumber & | operator= (const T &v) |
T | ll () const |
T | ul () const |
T | SetWithLimits (const T &v, const T &ll, const T &ul) |
T | SetLimits (const T &_ll, const T &_ul, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false) |
Arithmetic operators | |
With this a ScopeNumber<T> can be treated like a T | |
ScopeNumber & | operator+= (const ScopeNumber< T > &v) |
ScopeNumber & | operator+= (const T &_val) |
ScopeNumber & | operator-= (const ScopeNumber< T > &v) |
ScopeNumber & | operator-= (const T &_val) |
ScopeNumber & | operator*= (const ScopeNumber< T > &v) |
ScopeNumber & | operator*= (const T &_val) |
ScopeNumber & | operator/= (const ScopeNumber< T > &v) |
ScopeNumber & | operator/= (const T &_val) |
ScopeNumber | operator+ (const ScopeNumber< T > &v) const |
ScopeNumber | operator- (const ScopeNumber< T > &v) const |
ScopeNumber | operator* (const ScopeNumber< T > &v) const |
ScopeNumber | operator/ (const ScopeNumber< T > &v) const |
ScopeNumber | operator+ (const T &_val) const |
ScopeNumber | operator- (const T &_val) const |
ScopeNumber | operator* (const T &_val) const |
ScopeNumber | operator/ (const T &_val) const |
Comparison operators | |
With this a ScopeNumber<T> can be treated like a T | |
bool | operator< (const ScopeNumber< T > &r) const |
bool | operator< (const T &r) const |
bool | operator> (const ScopeNumber< T > &r) const |
bool | operator> (const T &r) const |
bool | operator== (const ScopeNumber< T > &r) const |
bool | operator!= (const ScopeNumber< T > &r) const |
Public Member Functions inherited from scope::ScopeValue< T > | |
ScopeValue (const T &_value=T(0), const std::wstring &_name=L"None") | |
ScopeValue & | operator= (const ScopeValue &v) |
ScopeValue & | operator= (const T &v) |
T | Value () const |
T | operator() () const |
operator T () const | |
virtual T | Set (const T &_v, const bool &_callguisignal=true, const bool &_callothersignal=true, const bool &_callatnochange=false) |
void | SetFromString (const std::wstring &str) |
std::wstring | ToChar () const |
void | AddToPropertyTree (boost::property_tree::wptree &pt) const |
void | SetFromPropertyTree (const boost::property_tree::wptree &pt) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
void | SetFromString (const std::wstring &str) |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
template<> | |
std::wstring | ToChar () const |
Public Member Functions inherited from scope::ScopeValueBase | |
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 Member Functions | |
T | CoerceValue (const T &v) const override |
Protected Attributes | |
T | lowerLimit |
T | upperLimit |
Protected Attributes inherited from scope::ScopeValue< T > | |
T | value |
Protected Attributes inherited from scope::ScopeValueBase | |
std::wstring | name |
std::mutex | mutex |
bool | readwrite |
signalchange_t | changesiggui |
signalchange_t | changesigother |
signalstate_t | statesig |
Additional Inherited Members | |
Protected Types inherited from scope::ScopeValueBase | |
typedef boost::signals2::signal< void()> | signalchange_t |
typedef boost::signals2::signal< void(bool)> | signalstate_t |
A templated class for a thread-safe numeric value, with signals that are called on value changes.
Derived from ScopeValue and ScopeValueBase (virtual, since ScopeValue is also derived from ScopeValueBase; but we want ScopeValueBase constructor).
Definition at line 7 of file XYControl.h.
|
inline |
[in] | _v | initial value (will be coerced) |
[in] | _ll | initial lower limit |
[in] | _ul | initial upper limit |
[in] | _name | name of the value |
Definition at line 31 of file ScopeNumber.h.
|
inline |
Safe copy constructor.
Definition at line 37 of file ScopeNumber.h.
|
inlineoverrideprotectedvirtual |
Does the actual coercion in between the lowerLimit and upperLimit.
Not thread-safe.
Reimplemented from scope::ScopeValue< T >.
Definition at line 22 of file ScopeNumber.h.
|
inline |
Safe assignment.
Definition at line 43 of file ScopeNumber.h.
|
inline |
Safe assignment, does keep name and limits.
Definition at line 53 of file ScopeNumber.h.
|
inline |
Definition at line 149 of file ScopeNumber.h.
|
inline |
Definition at line 155 of file ScopeNumber.h.
|
inline |
Sets new value and new limits at the same time.
Definition at line 161 of file ScopeNumber.h.
|
inline |
Sets the limits and coerces the value accordingly change signal is called if value has to be coerced.
[in] | ll | new lower limit |
[in] | ul | new upper limit |
[in] | _callguisignal | call signal to GUI slots |
[in] | _callothersignal | call signal to other slots |
[in] | _callatnochange | call signals also if value did not change |
Definition at line 174 of file ScopeNumber.h.
|
protected |
lower limit (including) to which the value is coerced
Definition at line 16 of file ScopeNumber.h.
|
protected |
upper limit (including) to which the value is coerced
Definition at line 19 of file ScopeNumber.h.