OpenMW
|
#include <variantimp.hpp>
Public Member Functions | |
VariantFloatData (const VariantDataBase *data=0) | |
virtual VariantDataBase * | clone () const |
virtual int | getInteger (bool default_=false) const |
virtual float | getFloat (bool default_=false) const |
virtual void | setInteger (int value) |
Will throw an exception, if type is not compatible with integer. | |
virtual void | setFloat (float value) |
Will throw an exception, if type is not compatible with float. | |
virtual void | read (ESMReader &esm, Variant::Format format, VarType type) |
If type is not supported by format, an exception is thrown via ESMReader::fail. | |
virtual void | write (ESMWriter &esm, Variant::Format format, VarType type) const |
If type is not supported by format, an exception is thrown. | |
virtual bool | isEqual (const VariantDataBase &value) const |
If the (C++) type of value does not match the type of *this, an exception is thrown. | |
Private Attributes | |
float | mValue |
ESM::VariantFloatData::VariantFloatData | ( | const VariantDataBase * | data = 0 | ) |
Calling the constructor with an incompatible data type will result in a silent default initialisation.
ESM::VariantDataBase * ESM::VariantFloatData::clone | ( | ) | const [virtual] |
Implements ESM::VariantDataBase.
float ESM::VariantFloatData::getFloat | ( | bool | default_ = false | ) | const [virtual] |
Will throw an exception, if value can not be represented as a float value.
default_ | Return a default value instead of throwing an exception. |
Reimplemented from ESM::VariantDataBase.
int ESM::VariantFloatData::getInteger | ( | bool | default_ = false | ) | const [virtual] |
Will throw an exception, if value can not be represented as an integer (implicit casting of float values is permitted).
default_ | Return a default value instead of throwing an exception. |
Reimplemented from ESM::VariantDataBase.
bool ESM::VariantFloatData::isEqual | ( | const VariantDataBase & | value | ) | const [virtual] |
If the (C++) type of value does not match the type of *this, an exception is thrown.
Implements ESM::VariantDataBase.
void ESM::VariantFloatData::read | ( | ESMReader & | esm, |
Variant::Format | format, | ||
VarType | type | ||
) | [virtual] |
If type is not supported by format, an exception is thrown via ESMReader::fail.
Implements ESM::VariantDataBase.
void ESM::VariantFloatData::setFloat | ( | float | value | ) | [virtual] |
Will throw an exception, if type is not compatible with float.
Reimplemented from ESM::VariantDataBase.
void ESM::VariantFloatData::setInteger | ( | int | value | ) | [virtual] |
Will throw an exception, if type is not compatible with integer.
Reimplemented from ESM::VariantDataBase.
void ESM::VariantFloatData::write | ( | ESMWriter & | esm, |
Variant::Format | format, | ||
VarType | type | ||
) | const [virtual] |
If type is not supported by format, an exception is thrown.
Implements ESM::VariantDataBase.
float ESM::VariantFloatData::mValue [private] |