#include <Variable.h>
Public Types | |
enum | Type { FLOAT_VAR, INT_VAR } |
This represents the type of variable it is. | |
Public Member Functions | |
Variable () | |
Variable (int copy) | |
Variable (float copy) | |
bool | operator== (const Variable &rhs) const |
Variable & | operator= (int value) |
Variable & | operator= (float value) |
void | Print (std::ostream &os) const |
virtual | ~Variable () |
Variable::Type | GetType () const |
void | SetType (Variable::Type type) |
Variable::Value | GetValue () const |
void | SetValue (Variable::Value value) |
void | SetValue (int value) |
void | SetValue (float value) |
Private Attributes | |
Variable::Value | mValue |
the value of the variable | |
Variable::Type | mType |
the type of the variable | |
Classes | |
union | Value |
green::Variable::Variable | ( | ) | [inline] |
Variables default to INT_VAR types
green::Variable::Variable | ( | int | copy | ) | [inline] |
Copy constructor from an int
green::Variable::Variable | ( | float | copy | ) | [inline] |
Copy constructor from a float
virtual green::Variable::~Variable | ( | ) | [inline, virtual] |
Default constructor defined as virtual
bool green::Variable::operator== | ( | const Variable & | rhs | ) | const [inline] |
Variable& green::Variable::operator= | ( | int | value | ) | [inline] |
Assignment to an integer. Sets the type to INT_VAR and the value appropriately.
value | The new value of the Variable, as an integer. |
Variable& green::Variable::operator= | ( | float | value | ) | [inline] |
Assignment to an float. Sets the type to FLOAT_VAR and the value appropriately.
value | The new value of the Variable, as a float. |
void green::Variable::Print | ( | std::ostream & | os | ) | const [inline] |
Variable::Type green::Variable::GetType | ( | ) | const [inline] |
Get the type of variable it is
void green::Variable::SetType | ( | Variable::Type | type | ) | [inline] |
Set the type of variable this is
type | The new type of variable |
Variable::Value green::Variable::GetValue | ( | ) | const [inline] |
Get the value of the variable
void green::Variable::SetValue | ( | Variable::Value | value | ) | [inline] |
Set the value of the variable
value | The new value of the variable |
void green::Variable::SetValue | ( | int | value | ) | [inline] |
Set the value of the variable to an int
value | The new value of the variable |
void green::Variable::SetValue | ( | float | value | ) | [inline] |
Set the value of the variable to a float
value | The new value of the variable |