General parameter type for member variables of a pre-specified class. More...
#include <parameter.hpp>
Public Member Functions | |
operator const T & () const | |
const T & | operator() () const |
void | operator() (const T &value) |
void | operator= (const T &value) |
Allow assignment from the underlying type. More... | |
Parameter () | |
Parameter (const T &value) | |
virtual | ~Parameter () |
Private Attributes | |
T | parameter |
General parameter type for member variables of a pre-specified class.
A Parameter is a templatised construct that formally defines an interface to a simple type embedded in a class.
Usage:
Definition:
and usage (like get/set, but much less verbose):
Definition at line 56 of file parameter.hpp.
|
inlineexplicit |
Definition at line 58 of file parameter.hpp.
|
inline |
Configures the parameter with the type's default value. Configures the parameter with a specified value.
value | : the value to instantiate the parameter with. |
Definition at line 63 of file parameter.hpp.
|
inlinevirtual |
Definition at line 65 of file parameter.hpp.
|
inline |
Convenience operator so that it can be treated as a normal variable if you wish (i.e. no () call needed). Note that we do not permit the returned reference to be modified as doing so would mean this class loses control of the variable.
Definition at line 87 of file parameter.hpp.
|
inline |
Formal access to the parameter's variable. Note that we do not permit the returned reference to be modified as doing so would mean this class loses control of the variable.
Definition at line 99 of file parameter.hpp.
|
inline |
Formal setting operator for the parameter's variable. Note that we dont need the reference here since we're copying into the private variable - you get the same number of constructions either way.
value | : the value to configure the internal variable with. |
Definition at line 107 of file parameter.hpp.
|
inline |
Allow assignment from the underlying type.
Note that this does not help with conversions for construction (or in argument passing to functions, because that is construction also).
value | : the value to configure the internal variable with. |
Definition at line 78 of file parameter.hpp.
|
private |
Definition at line 110 of file parameter.hpp.