The Sparta Modeling Framework
|
Provides a wrapper around a value to ensure that the value is assigned. More...
#include <ValidValue.hpp>
Public Types | |
typedef T | value_type |
Convenient typedef for the value type. | |
Public Member Functions | |
ValidValue () | |
Construct with no validity (not valid, uninitialized) | |
template<typename ... ArgsT> | |
ValidValue (ArgsT &&...args) | |
Construct with a valid starting value. | |
ValidValue (ValidValue &)=default | |
ValidValue (ValidValue &&v) | |
Allow moves. | |
ValidValue (const ValidValue &)=default | |
Allow copies. | |
ValidValue & | operator= (const ValidValue &)=default |
Allow assignments. | |
ValidValue & | operator= (ValidValue &&)=default |
value_type | operator= (const value_type &val) |
Assignment. | |
value_type | operator= (value_type &&val) |
Assignment. | |
bool | operator== (const value_type &val) const |
Compare equal. | |
bool | operator!= (const value_type &val) const |
Compare not equal. | |
bool | isValid () const |
Is this value valid. | |
operator const value_type & () const | |
Convert the ValidValue to the object it is. | |
operator value_type & () | |
Convert the ValidValue to the object it is. | |
const value_type & | getValue () const |
Get the value - const version. | |
value_type & | getValue () |
Get the value. | |
void | clearValid () |
Clear the validity of this object. | |
Provides a wrapper around a value to ensure that the value is assigned.
Definition at line 25 of file ValidValue.hpp.
typedef T sparta::utils::ValidValue< T >::value_type |
Convenient typedef for the value type.
Definition at line 29 of file ValidValue.hpp.
|
inline |
Construct with no validity (not valid, uninitialized)
Definition at line 32 of file ValidValue.hpp.
|
inline |
Construct with a valid starting value.
args | The value to start with |
This constructor will not be used when constructing with another sparta::ValidValue. The const/non-const copy constructors below should/will be used instead
Definition at line 46 of file ValidValue.hpp.
|
default |
Allow copies of direct ValidValue – non-const. This is to prevent the variatic template constructor from being used when the rvalue is another ValidValue
|
inline |
Allow moves.
Definition at line 57 of file ValidValue.hpp.
|
inline |
Clear the validity of this object.
Definition at line 161 of file ValidValue.hpp.
|
inline |
Get the value.
Definition at line 153 of file ValidValue.hpp.
|
inline |
Get the value - const version.
Definition at line 143 of file ValidValue.hpp.
|
inline |
|
inline |
Convert the ValidValue to the object it is.
Definition at line 123 of file ValidValue.hpp.
|
inline |
Convert the ValidValue to the object it is.
Definition at line 134 of file ValidValue.hpp.
|
inline |
Compare not equal.
val | The value to compare, asserts if this valid isn't valid |
Definition at line 106 of file ValidValue.hpp.
|
inline |
Assignment.
val | The value to assign, becomes immediately valid |
Definition at line 76 of file ValidValue.hpp.
|
inline |
Assignment.
val | The value to assign, becomes immediately valid |
Definition at line 86 of file ValidValue.hpp.
|
inline |
Compare equal.
val | The value to compare, asserts if this valid isn't valid |
Definition at line 96 of file ValidValue.hpp.