#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 | ) |
CLIPS::Value::Value | ( | float | x | ) |
CLIPS::Value::Value | ( | double | x | ) |
CLIPS::Value::Value | ( | short int | x | ) |
CLIPS::Value::Value | ( | unsigned short int | x | ) |
CLIPS::Value::Value | ( | int | x | ) |
CLIPS::Value::Value | ( | unsigned int | x | ) |
CLIPS::Value::Value | ( | long int | x | ) |
CLIPS::Value::Value | ( | char * | x, | |
Type | type = TYPE_STRING | |||
) |
CLIPS::Value::Value | ( | const std::string & | x, | |
Type | type = TYPE_STRING | |||
) |
CLIPS::Value::Value | ( | void * | x, | |
Type | type = TYPE_EXTERNAL_ADDRESS | |||
) |
CLIPS::Value::Value | ( | const Value & | value | ) |
References operator=().
CLIPS::Value::~Value | ( | ) |
void * CLIPS::Value::as_address | ( | ) | const |
References m_clips_type, m_value, CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
Referenced by operator void *(), 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 double(), operator float(), 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 int(), operator long int(), operator short int(), operator unsigned int(), operator unsigned short int(), 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 const char *(), operator std::string &(), operator!=(), operator==(), and CLIPS::value_to_data_object().
void CLIPS::Value::deallocate_storage | ( | ) | [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 |
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 |
References as_string().
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!= | ( | void * | x | ) | const |
References as_address().
bool CLIPS::Value::operator!= | ( | const char * | x | ) | const |
References as_string().
bool CLIPS::Value::operator!= | ( | const std::string & | x | ) | const |
References as_string().
bool CLIPS::Value::operator!= | ( | long int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | unsigned int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | unsigned short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator!= | ( | double | x | ) | const |
References as_float().
bool CLIPS::Value::operator!= | ( | float | x | ) | const |
References as_float().
Value & CLIPS::Value::operator= | ( | void * | x | ) |
Value & CLIPS::Value::operator= | ( | const char * | x | ) |
Value & CLIPS::Value::operator= | ( | const std::string & | x | ) |
Value & CLIPS::Value::operator= | ( | long int | x | ) |
Value & CLIPS::Value::operator= | ( | unsigned int | x | ) |
Value & CLIPS::Value::operator= | ( | int | x | ) |
Value & CLIPS::Value::operator= | ( | unsigned short int | x | ) |
Value & CLIPS::Value::operator= | ( | short int | x | ) |
Value & CLIPS::Value::operator= | ( | double | x | ) |
Value & CLIPS::Value::operator= | ( | float | x | ) |
bool CLIPS::Value::operator== | ( | void * | x | ) | const |
References as_address().
bool CLIPS::Value::operator== | ( | const char * | x | ) | const |
References as_string().
bool CLIPS::Value::operator== | ( | const std::string & | x | ) | const |
References as_string().
bool CLIPS::Value::operator== | ( | long int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | unsigned int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | unsigned short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | short int | x | ) | const |
References as_integer().
bool CLIPS::Value::operator== | ( | double | x | ) | const |
References as_float().
bool CLIPS::Value::operator== | ( | float | x | ) | const |
References as_float().
References m_clips_type, m_signal_changed, m_value, set_type(), CLIPS::TYPE_EXTERNAL_ADDRESS, and CLIPS::TYPE_INSTANCE_ADDRESS.
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 | ( | 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 | ( | unsigned int | x, | |
bool | change_type = false | |||
) |
Value & CLIPS::Value::set | ( | int | x, | |
bool | change_type = false | |||
) |
Value & CLIPS::Value::set | ( | unsigned short int | x, | |
bool | change_type = false | |||
) |
Value & CLIPS::Value::set | ( | short int | 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 | ( | float | x, | |
bool | change_type = false | |||
) |
Sets the underlying storage type.
References deallocate_storage(), 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 operator=(), set(), and Value().
sigc::signal< void > CLIPS::Value::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 defined Returns the CLIPS library type of this value
References m_clips_type.
Referenced by CLIPS::value_to_data_object().
Type CLIPS::Value::m_clips_type [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().
sigc::signal<void> CLIPS::Value::m_signal_changed [protected] |
void* CLIPS::Value::m_value [protected] |
Storage for the underlying value.
Referenced by as_address(), as_float(), as_integer(), as_string(), deallocate_storage(), operator=(), set(), set_type(), and size().