jaula API Reference version 1.4.0
|
Base class for handling values. More...
#include <jaula_value.h>
Public Types | |
enum | ValueType { TYPE_NULL, TYPE_BOOLEAN, TYPE_STRING, TYPE_NUMBER, TYPE_NUMBER_INT, TYPE_ARRAY, TYPE_OBJECT } |
Enumeration of available value types. More... | |
Public Member Functions | |
ValueType | getType (void) const |
Retrieves the value type for the instance. | |
Value & | operator= (Value const &orig) throw (Bad_Data_Type) |
Assignment operator. | |
virtual void | repr (std::ostream &ostr) const =0 |
Represents the instance in a stream. | |
virtual void | set (Value const &origin) throw (Bad_Data_Type) |
Copies the contents of one instance into another. | |
virtual | ~Value () |
Destructor. | |
Static Public Member Functions | |
static Value * | duplicate (Value const &orig) |
Creates a duplicate of a value. | |
Protected Member Functions | |
Value (ValueType Type) | |
Constructor. | |
Private Attributes | |
ValueType | Type_ |
Container for error code. |
Base class for handling values.
JAULA::Value::~Value | ( | ) | [virtual] |
Destructor.
JAULA::Value::Value | ( | ValueType | Type | ) | [protected] |
Constructor.
Type | Type of value to be contained by the instance |
Creates a duplicate of a value.
orig | Original instance to duplicate. |
References JAULA::Exception::addOrigin(), JAULA::Value_Object::getData(), JAULA::Value_Array::getData(), JAULA::Value_Number::getData(), JAULA::Value_Number_Int::getData(), JAULA::Value_String::getData(), and JAULA::Value_Boolean::getData().
Referenced by JAULA::Value_Array::addItem(), JAULA::Value_Object::set(), JAULA::Value_Array::set(), JAULA::Value_Array::Value_Array(), and JAULA::Value_Object::Value_Object().
Value::ValueType JAULA::Value::getType | ( | void | ) | const |
Value & JAULA::Value::operator= | ( | Value const & | orig | ) | throw (Bad_Data_Type) |
Assignment operator.
orig | Original instance to copy |
Bad_Data_Type | This exception is launched in case that origin and destination value types are different. |
References JAULA::Exception::addOrigin().
virtual void JAULA::Value::repr | ( | std::ostream & | ostr | ) | const [pure virtual] |
Represents the instance in a stream.
ostr | Stream where the instance is to be represented. |
Implemented in JAULA::Value_Array, JAULA::Value_Boolean, JAULA::Value_Null, JAULA::Value_Number, JAULA::Value_Number_Int, JAULA::Value_Object, and JAULA::Value_String.
Referenced by operator<<().
void JAULA::Value::set | ( | Value const & | origin | ) | throw (Bad_Data_Type) [virtual] |
Copies the contents of one instance into another.
origin | Reference to the value to be copied. |
Bad_Data_Type | This exception is launched in case that origin and destination value types are different. |
Reimplemented in JAULA::Value_Array, JAULA::Value_Boolean, JAULA::Value_Null, JAULA::Value_Number, JAULA::Value_Number_Int, JAULA::Value_Object, and JAULA::Value_String.
Referenced by JAULA::Value_String::set(), JAULA::Value_Object::set(), JAULA::Value_Number_Int::set(), JAULA::Value_Number::set(), JAULA::Value_Null::set(), JAULA::Value_Boolean::set(), and JAULA::Value_Array::set().
ValueType JAULA::Value::Type_ [private] |
Container for error code.
Referenced by getType().