Template Class Variable¶
Defined in File Objects.h
Inheritance Relationships¶
Base Type¶
public uconfig::Object(Class Object)
Class Documentation¶
-
template<typename
T>
classuconfig::Variable: public uconfig::Object¶ Variable object.
- tparam T
Type of underlying variable to store.
Public Types
-
template<typename
F>
usingiface_type= VariableIface<T, F>¶
Public Functions
-
Variable()¶ Constructor.
-
virtual
~Variable() = default¶ Destructor.
-
virtual bool
Initialized() const noexcept override¶ Check if variable has a value.
- Returns
true if it has, false otherwise.
-
virtual bool
Optional() const noexcept override¶ Check if variable is marked as optional.
- Returns
true if has been, false otherwise.
-
T &
Get()¶ Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A reference to the value.
-
const T &
Get() const¶ Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A const reference to the value.
-
T &
operator*()¶ Dereference operator.
Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A reference to the value.
-
const T &
operator*() const¶ Dereference operator.
Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A const reference to the value.
-
T *
operator->()¶ Structure dereference operator.
Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A pointer to the value.
-
const T *
operator->() const¶ Structure dereference operator.
Read the value.
- Throws
uconfig::Error – Thrown if variable has no value.
- Returns
A const pointer to the value.
-
explicit
operator T&()¶ Explicit conversation to
T&.- Throws
uconfig::Error – Thrown if variable has no value.
-
explicit
operator const T&() const¶ Explicit conversation to
const T&.- Throws
uconfig::Error – Thrown if variable has no value.
Protected Attributes
-
bool
optional_= false¶
Friends
- friend class VariableIface