#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, m_value, CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Referenced by operator!=(), and operator==().
double CLIPS::Value::as_float | ( | ) | const |
References m_clips_type, m_value, CLIPS::TYPE_FLOAT, and CLIPS::TYPE_INTEGER.
Referenced by operator!=(), operator==(), and CLIPS::value_to_data_object().
long int CLIPS::Value::as_integer | ( | ) | const |
References m_clips_type, m_value, CLIPS::TYPE_FLOAT, and CLIPS::TYPE_INTEGER.
Referenced by operator!=(), operator==(), and CLIPS::value_to_data_object().
std::string & CLIPS::Value::as_string | ( | ) | const |
References m_clips_type, m_value, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_STRING, and CLIPS::TYPE_SYMBOL.
Referenced by operator!=(), operator==(), and CLIPS::value_to_data_object().
|
protected |
References m_clips_type, m_value, CLIPS::TYPE_EXTERNAL_ADDRESS, CLIPS::TYPE_FLOAT, CLIPS::TYPE_INSTANCE_ADDRESS, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_INTEGER, CLIPS::TYPE_STRING, and CLIPS::TYPE_SYMBOL.
Referenced by set_type(), and ~Value().
CLIPS::Value::operator const char * | ( | ) | const |
CLIPS::Value::operator double | ( | ) | const |
CLIPS::Value::operator float | ( | ) | const |
CLIPS::Value::operator int | ( | ) | const |
CLIPS::Value::operator long int | ( | ) | const |
CLIPS::Value::operator short int | ( | ) | const |
CLIPS::Value::operator std::string & | ( | ) | const |
CLIPS::Value::operator unsigned int | ( | ) | const |
CLIPS::Value::operator unsigned short int | ( | ) | const |
CLIPS::Value::operator void * | ( | ) | const |
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 m_clips_type, m_signal_changed, m_value, set_type(), CLIPS::TYPE_FLOAT, and CLIPS::TYPE_INTEGER.
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 m_clips_type, m_signal_changed, m_value, set_type(), CLIPS::TYPE_FLOAT, and CLIPS::TYPE_INTEGER.
Value & CLIPS::Value::set | ( | const std::string & | x, |
bool | change_type = false , |
||
Type | type = TYPE_STRING |
||
) |
References m_clips_type, m_signal_changed, m_value, set_type(), CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_STRING, and CLIPS::TYPE_SYMBOL.
Value & CLIPS::Value::set | ( | const char * | x, |
bool | change_type = false , |
||
Type | type = TYPE_STRING |
||
) |
References type().
Value & CLIPS::Value::set | ( | void * | x, |
bool | change_type = false , |
||
Type | type = TYPE_EXTERNAL_ADDRESS |
||
) |
References m_clips_type, m_signal_changed, m_value, set_type(), CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Sets the underlying storage type.
References deallocate_storage(), m_clips_type, m_value, type(), CLIPS::TYPE_EXTERNAL_ADDRESS, CLIPS::TYPE_FLOAT, CLIPS::TYPE_INSTANCE_ADDRESS, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_INTEGER, CLIPS::TYPE_STRING, and CLIPS::TYPE_SYMBOL.
Referenced by operator=(), set(), and Value().
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, m_value, CLIPS::TYPE_EXTERNAL_ADDRESS, CLIPS::TYPE_FLOAT, CLIPS::TYPE_INSTANCE_ADDRESS, CLIPS::TYPE_INSTANCE_NAME, CLIPS::TYPE_INTEGER, CLIPS::TYPE_STRING, and CLIPS::TYPE_SYMBOL.
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 definedReturns the CLIPS library type of this value
References m_clips_type.
Referenced by set(), set_type(), and CLIPS::value_to_data_object().
|
protected |
Stores the CLIPS type information.
Referenced by as_address(), as_float(), as_integer(), as_string(), deallocate_storage(), operator=(), set(), set_type(), size(), and type().
|
protected |
Signal emitted when underlying data is changed.
Referenced by set(), and signal_changed().
|
protected |
Storage for the underlying value.
Referenced by as_address(), as_float(), as_integer(), as_string(), deallocate_storage(), operator=(), set(), set_type(), and size().