#include <value.h>
Public Member Functions | |
Value (Type type) | |
Typeless constructor. | |
Value (float x) | |
Constructor sets value and CLIPS type to FLOAT. | |
Value (double x) | |
Constructor sets value and CLIPS type to FLOAT. | |
Value (short int x) | |
Constructor sets value and CLIPS type to INTEGER. | |
Value (unsigned short int x) | |
Constructor sets value and CLIPS type to INTEGER. | |
Value (int x) | |
Constructor sets value and CLIPS type to INTEGER. | |
Value (unsigned int x) | |
Constructor sets value and CLIPS type to INTEGER. | |
Value (long int x) | |
Constructor sets value and CLIPS type to INTEGER. | |
Value (char *x, Type type=TYPE_STRING) | |
Constructor sets value and CLIPS type. | |
Value (const std::string &x, Type type=TYPE_STRING) | |
Constructor sets value and CLIPS type. | |
Value (void *x, Type type=TYPE_EXTERNAL_ADDRESS) | |
Constructor sets value and CLIPS type to. | |
Value (const Value &value) | |
~Value () | |
Destructor. | |
double | as_float () const |
long int | as_integer () const |
std::string & | as_string () const |
void * | as_address () const |
Value & | set (float x, bool change_type=false) |
Value & | set (double x, bool change_type=false) |
Value & | set (short int x, bool change_type=false) |
Value & | set (unsigned short int x, bool change_type=false) |
Value & | set (int x, bool change_type=false) |
Value & | set (unsigned int x, bool change_type=false) |
Value & | set (long int x, bool change_type=false) |
Value & | set (const std::string &x, bool change_type=false, Type type=TYPE_STRING) |
Value & | set (const char *x, bool change_type=false, Type type=TYPE_STRING) |
Value & | set (void *x, bool change_type=false, Type type=TYPE_EXTERNAL_ADDRESS) |
operator float () const | |
operator double () const | |
operator short int () const | |
operator unsigned short int () const | |
operator int () const | |
operator unsigned int () const | |
operator long int () const | |
operator std::string & () const | |
operator const char * () const | |
operator void * () const | |
size_t | size () const |
Function call syntax to get the value with var() notation. | |
Value & | operator= (float x) |
Allows assignment to the property from the contained value type. | |
Value & | operator= (double x) |
Value & | operator= (short int x) |
Value & | operator= (unsigned short int x) |
Value & | operator= (int x) |
Value & | operator= (unsigned int x) |
Value & | operator= (long int x) |
Value & | operator= (const std::string &x) |
Value & | operator= (const char *x) |
Value & | operator= (void *x) |
Value & | operator= (const Value &x) |
bool | operator== (float x) const |
bool | operator== (double x) const |
bool | operator== (short int x) const |
bool | operator== (unsigned short int x) const |
bool | operator== (int x) const |
bool | operator== (unsigned int x) const |
bool | operator== (long int x) const |
bool | operator== (const std::string &x) const |
bool | operator== (const char *x) const |
bool | operator== (void *x) const |
bool | operator!= (float x) const |
bool | operator!= (double x) const |
bool | operator!= (short int x) const |
bool | operator!= (unsigned short int x) const |
bool | operator!= (int x) const |
bool | operator!= (unsigned int x) const |
bool | operator!= (long int x) const |
bool | operator!= (const std::string &x) const |
bool | operator!= (const char *x) const |
bool | operator!= (void *x) const |
Type | type () const |
Arithmetic assignment operator. | |
Type | set_type (Type type) |
Sets the underlying storage type. | |
sigc::signal< void > | signal_changed () |
Signal emitted when the value is changed. | |
Protected Member Functions | |
void | deallocate_storage () |
Protected Attributes | |
void * | m_value |
Storage for the underlying value. | |
Type | m_clips_type |
Stores the CLIPS type information. | |
sigc::signal< void > | m_signal_changed |
Signal emitted when underlying data is changed. |
CLIPS::Value::Value | ( | Type | type | ) |
Typeless constructor.
References set_type().
CLIPS::Value::Value | ( | float | x | ) |
Constructor sets value and CLIPS type to FLOAT.
References set_type(), and CLIPS::TYPE_FLOAT.
CLIPS::Value::Value | ( | double | x | ) |
Constructor sets value and CLIPS type to FLOAT.
References set_type(), and CLIPS::TYPE_FLOAT.
CLIPS::Value::Value | ( | short int | x | ) |
Constructor sets value and CLIPS type to INTEGER.
References set_type(), and CLIPS::TYPE_INTEGER.
CLIPS::Value::Value | ( | unsigned short int | x | ) |
Constructor sets value and CLIPS type to INTEGER.
References set_type(), and CLIPS::TYPE_INTEGER.
CLIPS::Value::Value | ( | int | x | ) |
Constructor sets value and CLIPS type to INTEGER.
References set_type(), and CLIPS::TYPE_INTEGER.
CLIPS::Value::Value | ( | unsigned int | x | ) |
Constructor sets value and CLIPS type to INTEGER.
References set_type(), and CLIPS::TYPE_INTEGER.
CLIPS::Value::Value | ( | long int | x | ) |
Constructor sets value and CLIPS type to INTEGER.
References set_type(), and CLIPS::TYPE_INTEGER.
CLIPS::Value::Value | ( | char * | x, |
Type | type = TYPE_STRING |
||
) |
Constructor sets value and CLIPS type.
References set_type().
CLIPS::Value::Value | ( | const std::string & | x, |
Type | type = TYPE_STRING |
||
) |
Constructor sets value and CLIPS type.
References set_type().
CLIPS::Value::Value | ( | void * | x, |
Type | type = TYPE_EXTERNAL_ADDRESS |
||
) |
Constructor sets value and CLIPS type to.
References set_type().
CLIPS::Value::Value | ( | const Value & | value | ) |
References operator=().
CLIPS::Value::~Value | ( | ) |
Destructor.
References deallocate_storage().
void * CLIPS::Value::as_address | ( | ) | const |
References m_clips_type, CLIPS::TYPE_EXTERNAL_ADDRESS, CLIPS::TYPE_INSTANCE_ADDRESS, and m_value.
Referenced by operator void *(), operator==(), and operator!=().
double CLIPS::Value::as_float | ( | ) | const |
References m_clips_type, CLIPS::TYPE_FLOAT, m_value, and CLIPS::TYPE_INTEGER.
Referenced by CLIPS::value_to_data_object(), operator float(), operator double(), operator==(), and operator!=().
long int CLIPS::Value::as_integer | ( | ) | const |
References m_clips_type, CLIPS::TYPE_FLOAT, m_value, and CLIPS::TYPE_INTEGER.
Referenced by CLIPS::value_to_data_object(), operator short int(), operator unsigned short int(), operator int(), operator unsigned int(), operator long int(), operator==(), and operator!=().
std::string & CLIPS::Value::as_string | ( | ) | const |
References m_clips_type, CLIPS::TYPE_STRING, CLIPS::TYPE_SYMBOL, CLIPS::TYPE_INSTANCE_NAME, and m_value.
Referenced by CLIPS::value_to_data_object(), operator const char *(), operator==(), and operator!=().
void CLIPS::Value::deallocate_storage | ( | ) | [protected] |
References m_value, m_clips_type, CLIPS::TYPE_FLOAT, CLIPS::TYPE_INTEGER, CLIPS::TYPE_SYMBOL, CLIPS::TYPE_STRING, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Referenced by ~Value(), and set_type().
CLIPS::Value::operator const char * | ( | ) | const |
References as_string().
CLIPS::Value::operator double | ( | ) | const |
References as_float().
CLIPS::Value::operator float | ( | ) | const |
References as_float().
CLIPS::Value::operator int | ( | ) | const |
References as_integer().
CLIPS::Value::operator long int | ( | ) | const |
References as_integer().
CLIPS::Value::operator short int | ( | ) | const |
References as_integer().
CLIPS::Value::operator std::string & | ( | ) | const |
CLIPS::Value::operator unsigned int | ( | ) | const |
References as_integer().
CLIPS::Value::operator unsigned short int | ( | ) | const |
References as_integer().
CLIPS::Value::operator void * | ( | ) | const |
References as_address().
bool CLIPS::Value::operator!= | ( | float | x | ) | const |
References as_float().
bool CLIPS::Value::operator!= | ( | double | x | ) | const |
References as_float().
bool CLIPS::Value::operator!= | ( | short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | unsigned short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | unsigned int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | long int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | const std::string & | x | ) | const |
References as_string().
bool CLIPS::Value::operator!= | ( | const char * | x | ) | const |
References as_string().
bool CLIPS::Value::operator!= | ( | void * | x | ) | const |
References as_address().
Value & CLIPS::Value::operator= | ( | float | x | ) |
Allows assignment to the property from the contained value type.
Referenced by Value().
Value & CLIPS::Value::operator= | ( | double | x | ) |
Value & CLIPS::Value::operator= | ( | short int | x | ) |
Value & CLIPS::Value::operator= | ( | unsigned short int | x | ) |
Value & CLIPS::Value::operator= | ( | int | x | ) |
Value & CLIPS::Value::operator= | ( | unsigned int | x | ) |
Value & CLIPS::Value::operator= | ( | long int | x | ) |
Value & CLIPS::Value::operator= | ( | const std::string & | x | ) |
Value & CLIPS::Value::operator= | ( | const char * | x | ) |
Value & CLIPS::Value::operator= | ( | void * | x | ) |
bool CLIPS::Value::operator== | ( | float | x | ) | const |
References as_float().
bool CLIPS::Value::operator== | ( | double | x | ) | const |
References as_float().
bool CLIPS::Value::operator== | ( | short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | unsigned short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | unsigned int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | long int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | const std::string & | x | ) | const |
References as_string().
bool CLIPS::Value::operator== | ( | const char * | x | ) | const |
References as_string().
bool CLIPS::Value::operator== | ( | void * | x | ) | const |
References as_address().
Value & CLIPS::Value::set | ( | float | x, |
bool | change_type = false |
||
) |
Value & CLIPS::Value::set | ( | double | x, |
bool | change_type = false |
||
) |
References set_type(), CLIPS::TYPE_FLOAT, m_clips_type, CLIPS::TYPE_INTEGER, m_value, and m_signal_changed.
Value & CLIPS::Value::set | ( | short int | x, |
bool | change_type = false |
||
) |
Value & CLIPS::Value::set | ( | unsigned short int | x, |
bool | change_type = false |
||
) |
Value & CLIPS::Value::set | ( | int | x, |
bool | change_type = false |
||
) |
Value & CLIPS::Value::set | ( | unsigned int | x, |
bool | change_type = false |
||
) |
Value & CLIPS::Value::set | ( | long int | x, |
bool | change_type = false |
||
) |
References set_type(), CLIPS::TYPE_INTEGER, m_clips_type, CLIPS::TYPE_FLOAT, m_value, and m_signal_changed.
Value & CLIPS::Value::set | ( | const std::string & | x, |
bool | change_type = false , |
||
Type | type = TYPE_STRING |
||
) |
References set_type(), m_clips_type, CLIPS::TYPE_STRING, CLIPS::TYPE_SYMBOL, CLIPS::TYPE_INSTANCE_NAME, m_value, and m_signal_changed.
References type().
References set_type(), m_clips_type, CLIPS::TYPE_EXTERNAL_ADDRESS, CLIPS::TYPE_INSTANCE_ADDRESS, m_value, and m_signal_changed.
Sets the underlying storage type.
References m_value, deallocate_storage(), m_clips_type, type(), CLIPS::TYPE_FLOAT, CLIPS::TYPE_INTEGER, CLIPS::TYPE_SYMBOL, CLIPS::TYPE_STRING, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Referenced by Value(), set(), and operator=().
sigc::signal< void > CLIPS::Value::signal_changed | ( | ) |
Signal emitted when the value is changed.
References m_signal_changed.
size_t CLIPS::Value::size | ( | ) | const |
Function call syntax to get the value with var() notation.
Function call syntax to set the value with var(value) notation. Returns the RTTI type id of the contained type Returns the size in bytes of the contained type, and not necessarily the size of this class.
References m_clips_type, CLIPS::TYPE_FLOAT, CLIPS::TYPE_INTEGER, CLIPS::TYPE_SYMBOL, CLIPS::TYPE_STRING, CLIPS::TYPE_INSTANCE_NAME, m_value, CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Type CLIPS::Value::type | ( | ) | const |
Arithmetic assignment operator.
This method is implemented as a template for two reasons:
T + X must be well defined Arithmetic assignment operator
This method is implemented as a template for two reasons:
T - X must be well defined Arithmetic assignment operator
This method is implemented as a template for two reasons:
T * X must be well defined Arithmetic assignment operator
This method is implemented as a template for two reasons:
T / X must be well defined Arithmetic assignment operator
This method is implemented as a template for two reasons:
T % X must be well defined Returns the CLIPS library type of this value
References m_clips_type.
Referenced by CLIPS::value_to_data_object(), set(), and set_type().
Type CLIPS::Value::m_clips_type [protected] |
Stores the CLIPS type information.
Referenced by as_float(), as_integer(), as_string(), as_address(), set(), size(), operator=(), type(), set_type(), and deallocate_storage().
sigc::signal<void> CLIPS::Value::m_signal_changed [protected] |
Signal emitted when underlying data is changed.
Referenced by set(), and signal_changed().
void* CLIPS::Value::m_value [protected] |
Storage for the underlying value.
Referenced by as_float(), as_integer(), as_string(), as_address(), set(), size(), operator=(), set_type(), and deallocate_storage().