The Sparta Modeling Framework
|
Provides a wrapper around a value to ensure that once the value is frozen or locked, it cannot be overwritten again. More...
#include <LockedValue.hpp>
Public Types | |
typedef T | value_type |
Convenient typedef for the value type. | |
Public Member Functions | |
LockedValue () | |
This is the LockedValue Default Constructor. | |
LockedValue (const T &value) | |
This is the LockedValue Constructor with initial value as parameter. | |
LockedValue (const T &value, const bool lock) | |
This is the LockedValue Constructor with initial value and lock as parameter. | |
LockedValue< T > & | operator= (const LockedValue< T > &)=delete |
Copy-Assignment of a LockedValue to another LockedValue is a deleted function. | |
LockedValue< T > & | operator= (const T &value) |
This is the assignment operator of the LockedValue class from a given resource. | |
void | setAndLock (const T &value) |
This method assigns a value to LockedValue class and immediately locks it. | |
void | lock () |
Lock the LockedValue instance immediately. | |
bool | isLocked () const |
Query if LockedValue instance is locked. | |
const value_type & | getValue () const |
Get the value of the underlying resource of the LockedValue. | |
value_type & | getValue () |
get the value of the underlying resource of the lockedvalue. | |
operator const value_type & () const | |
Convert the LockedValue to its underlying resource. | |
operator value_type & () | |
Convert the LockedValue to its underlying resource. | |
bool | operator== (const value_type &value) const |
Overload the compare equal operator for LockedValue class. | |
bool | operator!= (const value_type &value) const |
Overload the compare not equal operator for LockedValue class. | |
Provides a wrapper around a value to ensure that once the value is frozen or locked, it cannot be overwritten again.
Definition at line 40 of file LockedValue.hpp.
typedef T sparta::utils::LockedValue< T >::value_type |
Convenient typedef for the value type.
Definition at line 43 of file LockedValue.hpp.
|
inline |
This is the LockedValue Default Constructor.
Definition at line 46 of file LockedValue.hpp.
|
inlineexplicit |
This is the LockedValue Constructor with initial value as parameter.
Definition at line 49 of file LockedValue.hpp.
|
inline |
This is the LockedValue Constructor with initial value and lock as parameter.
Definition at line 52 of file LockedValue.hpp.
|
inline |
get the value of the underlying resource of the lockedvalue.
Definition at line 95 of file LockedValue.hpp.
|
inline |
Get the value of the underlying resource of the LockedValue.
Definition at line 88 of file LockedValue.hpp.
|
inline |
Query if LockedValue instance is locked.
Definition at line 81 of file LockedValue.hpp.
|
inline |
Lock the LockedValue instance immediately.
Definition at line 76 of file LockedValue.hpp.
|
inline |
Convert the LockedValue to its underlying resource.
Definition at line 102 of file LockedValue.hpp.
|
inline |
Convert the LockedValue to its underlying resource.
Definition at line 109 of file LockedValue.hpp.
|
inline |
Overload the compare not equal operator for LockedValue class.
Definition at line 119 of file LockedValue.hpp.
|
inline |
This is the assignment operator of the LockedValue class from a given resource.
Definition at line 59 of file LockedValue.hpp.
|
inline |
Overload the compare equal operator for LockedValue class.
Definition at line 114 of file LockedValue.hpp.
|
inline |
This method assigns a value to LockedValue class and immediately locks it.
Definition at line 68 of file LockedValue.hpp.