clipsmm - C++ CLIPS Interface Library

clipsmm logo
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CLIPS::Value Class Reference

#include <value.h>

Inherits sigc::trackable.

Public Member Functions

 Value ()
 Typeless constructor.
 
 Value (Type type)
 Type 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 (long long int x)
 Constructor sets value and CLIPS type to INTEGER.
 
 Value (const 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 long int as_integer () const
 
std::string & as_string () const
 
voidas_address () const
 
Valueset (float x, bool change_type=false)
 
Valueset (double x, bool change_type=false)
 
Valueset (short int x, bool change_type=false)
 
Valueset (unsigned short int x, bool change_type=false)
 
Valueset (int x, bool change_type=false)
 
Valueset (unsigned int x, bool change_type=false)
 
Valueset (long int x, bool change_type=false)
 
Valueset (long long int x, bool change_type=false)
 
Valueset (const std::string &x, bool change_type=false, Type type=TYPE_STRING)
 
Valueset (const char *x, bool change_type=false, Type type=TYPE_STRING)
 
Valueset (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 long 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.
 
Valueoperator= (float x)
 Allows assignment to the property from the contained value type.
 
Valueoperator= (double x)
 
Valueoperator= (short int x)
 
Valueoperator= (unsigned short int x)
 
Valueoperator= (int x)
 
Valueoperator= (unsigned int x)
 
Valueoperator= (long int x)
 
Valueoperator= (long long int x)
 
Valueoperator= (const std::string &x)
 
Valueoperator= (const char *x)
 
Valueoperator= (void *x)
 
Valueoperator= (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== (long 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!= (long 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< voidsignal_changed ()
 Signal emitted when the value is changed.
 

Protected Member Functions

void deallocate_storage ()
 

Protected Attributes

voidm_value
 Storage for the underlying value.
 
Type m_clips_type
 Stores the CLIPS type information.
 
sigc::signal< voidm_signal_changed
 Signal emitted when underlying data is changed.
 

Detailed Description

Author
Rick L. Vinyard, Jr. rviny.nosp@m.ard@.nosp@m.cs.nm.nosp@m.su.e.nosp@m.du
Tim Niemueller tim@n.nosp@m.iemu.nosp@m.eller.nosp@m..de

Constructor & Destructor Documentation

◆ Value() [1/14]

CLIPS::Value::Value ( )

Typeless constructor.

References set_type(), and CLIPS::TYPE_UNKNOWN.

◆ Value() [2/14]

CLIPS::Value::Value ( Type type)

Type constructor.

References set_type().

◆ Value() [3/14]

CLIPS::Value::Value ( float x)

Constructor sets value and CLIPS type to FLOAT.

References set(), set_type(), and CLIPS::TYPE_FLOAT.

◆ Value() [4/14]

CLIPS::Value::Value ( double x)

Constructor sets value and CLIPS type to FLOAT.

References set(), set_type(), and CLIPS::TYPE_FLOAT.

◆ Value() [5/14]

CLIPS::Value::Value ( short int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [6/14]

CLIPS::Value::Value ( unsigned short int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [7/14]

CLIPS::Value::Value ( int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [8/14]

CLIPS::Value::Value ( unsigned int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [9/14]

CLIPS::Value::Value ( long int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [10/14]

CLIPS::Value::Value ( long long int x)

Constructor sets value and CLIPS type to INTEGER.

References set(), set_type(), and CLIPS::TYPE_INTEGER.

◆ Value() [11/14]

CLIPS::Value::Value ( const char * x,
Type type = TYPE_STRING )

Constructor sets value and CLIPS type.

References set(), and set_type().

◆ Value() [12/14]

CLIPS::Value::Value ( const std::string & x,
Type type = TYPE_STRING )

Constructor sets value and CLIPS type.

References set(), and set_type().

◆ Value() [13/14]

CLIPS::Value::Value ( void * x,
Type type = TYPE_EXTERNAL_ADDRESS )

Constructor sets value and CLIPS type to.

References set(), and set_type().

◆ Value() [14/14]

CLIPS::Value::Value ( const Value & value)

References operator=().

◆ ~Value()

CLIPS::Value::~Value ( )

Destructor.

References deallocate_storage().

Member Function Documentation

◆ as_address()

void * CLIPS::Value::as_address ( ) const

◆ as_float()

double CLIPS::Value::as_float ( ) const

◆ as_integer()

long long int CLIPS::Value::as_integer ( ) const

◆ as_string()

std::string & CLIPS::Value::as_string ( ) const

◆ deallocate_storage()

void CLIPS::Value::deallocate_storage ( )
protected

◆ operator const char *()

CLIPS::Value::operator const char * ( ) const

◆ operator double()

CLIPS::Value::operator double ( ) const

◆ operator float()

CLIPS::Value::operator float ( ) const

◆ operator int()

CLIPS::Value::operator int ( ) const

◆ operator long int()

CLIPS::Value::operator long int ( ) const

◆ operator long long int()

CLIPS::Value::operator long long int ( ) const

◆ operator short int()

CLIPS::Value::operator short int ( ) const

◆ operator std::string &()

CLIPS::Value::operator std::string & ( ) const

◆ operator unsigned int()

CLIPS::Value::operator unsigned int ( ) const

◆ operator unsigned short int()

CLIPS::Value::operator unsigned short int ( ) const

◆ operator void *()

CLIPS::Value::operator void * ( ) const

◆ operator!=() [1/11]

bool CLIPS::Value::operator!= ( const char * x) const

References as_string(), and CLIPSPointer.

◆ operator!=() [2/11]

bool CLIPS::Value::operator!= ( const std::string & x) const

References as_string(), and CLIPSPointer.

◆ operator!=() [3/11]

bool CLIPS::Value::operator!= ( double x) const

References as_float(), and CLIPSPointer.

◆ operator!=() [4/11]

bool CLIPS::Value::operator!= ( float x) const

References as_float(), and CLIPSPointer.

◆ operator!=() [5/11]

bool CLIPS::Value::operator!= ( int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [6/11]

bool CLIPS::Value::operator!= ( long int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [7/11]

bool CLIPS::Value::operator!= ( long long int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [8/11]

bool CLIPS::Value::operator!= ( short int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [9/11]

bool CLIPS::Value::operator!= ( unsigned int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [10/11]

bool CLIPS::Value::operator!= ( unsigned short int x) const

References as_integer(), and CLIPSPointer.

◆ operator!=() [11/11]

bool CLIPS::Value::operator!= ( void * x) const

References as_address(), and CLIPSPointer.

◆ operator=() [1/12]

Value & CLIPS::Value::operator= ( const char * x)

References set().

◆ operator=() [2/12]

Value & CLIPS::Value::operator= ( const std::string & x)

References set().

◆ operator=() [3/12]

Value & CLIPS::Value::operator= ( const Value & x)

◆ operator=() [4/12]

Value & CLIPS::Value::operator= ( double x)

References set().

◆ operator=() [5/12]

Value & CLIPS::Value::operator= ( float x)

Allows assignment to the property from the contained value type.

References set().

Referenced by Value().

◆ operator=() [6/12]

Value & CLIPS::Value::operator= ( int x)

References set().

◆ operator=() [7/12]

Value & CLIPS::Value::operator= ( long int x)

References set().

◆ operator=() [8/12]

Value & CLIPS::Value::operator= ( long long int x)

References set().

◆ operator=() [9/12]

Value & CLIPS::Value::operator= ( short int x)

References set().

◆ operator=() [10/12]

Value & CLIPS::Value::operator= ( unsigned int x)

References set().

◆ operator=() [11/12]

Value & CLIPS::Value::operator= ( unsigned short int x)

References set().

◆ operator=() [12/12]

Value & CLIPS::Value::operator= ( void * x)

References set().

◆ operator==() [1/11]

bool CLIPS::Value::operator== ( const char * x) const

References as_string(), and CLIPSPointer.

◆ operator==() [2/11]

bool CLIPS::Value::operator== ( const std::string & x) const

References as_string(), and CLIPSPointer.

◆ operator==() [3/11]

bool CLIPS::Value::operator== ( double x) const

References as_float(), and CLIPSPointer.

◆ operator==() [4/11]

bool CLIPS::Value::operator== ( float x) const

References as_float(), and CLIPSPointer.

◆ operator==() [5/11]

bool CLIPS::Value::operator== ( int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [6/11]

bool CLIPS::Value::operator== ( long int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [7/11]

bool CLIPS::Value::operator== ( long long int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [8/11]

bool CLIPS::Value::operator== ( short int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [9/11]

bool CLIPS::Value::operator== ( unsigned int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [10/11]

bool CLIPS::Value::operator== ( unsigned short int x) const

References as_integer(), and CLIPSPointer.

◆ operator==() [11/11]

bool CLIPS::Value::operator== ( void * x) const

References as_address(), and CLIPSPointer.

◆ set() [1/11]

Value & CLIPS::Value::set ( const char * x,
bool change_type = false,
Type type = TYPE_STRING )

References CLIPSPointer, set(), and type().

◆ set() [2/11]

Value & CLIPS::Value::set ( const std::string & x,
bool change_type = false,
Type type = TYPE_STRING )

◆ set() [3/11]

Value & CLIPS::Value::set ( double x,
bool change_type = false )

◆ set() [4/11]

Value & CLIPS::Value::set ( float x,
bool change_type = false )

◆ set() [5/11]

Value & CLIPS::Value::set ( int x,
bool change_type = false )

References CLIPSPointer, and set().

◆ set() [6/11]

Value & CLIPS::Value::set ( long int x,
bool change_type = false )

References CLIPSPointer, and set().

◆ set() [7/11]

Value & CLIPS::Value::set ( long long int x,
bool change_type = false )

◆ set() [8/11]

Value & CLIPS::Value::set ( short int x,
bool change_type = false )

References CLIPSPointer, and set().

◆ set() [9/11]

Value & CLIPS::Value::set ( unsigned int x,
bool change_type = false )

References CLIPSPointer, and set().

◆ set() [10/11]

Value & CLIPS::Value::set ( unsigned short int x,
bool change_type = false )

References CLIPSPointer, and set().

◆ set() [11/11]

Value & CLIPS::Value::set ( void * x,
bool change_type = false,
Type type = TYPE_EXTERNAL_ADDRESS )

◆ set_type()

Type CLIPS::Value::set_type ( Type type)

◆ signal_changed()

sigc::signal< void > CLIPS::Value::signal_changed ( )

Signal emitted when the value is changed.

References m_signal_changed.

◆ size()

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 CLIPSPointer, 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()

Type CLIPS::Value::type ( ) const

Arithmetic assignment operator.

This method is implemented as a template for two reasons:

  • So that it will work with a variety of operands
  • So that a stub will not be generated if the operator is not defined for T

T + X must be well defined Arithmetic assignment operator

This method is implemented as a template for two reasons:

  • So that it will work with a variety of operands
  • So that a stub will not be generated if the operator is not defined for T

T - X must be well defined Arithmetic assignment operator

This method is implemented as a template for two reasons:

  • So that it will work with a variety of operands
  • So that a stub will not be generated if the operator is not defined for T

T * X must be well defined Arithmetic assignment operator

This method is implemented as a template for two reasons:

  • So that it will work with a variety of operands
  • So that a stub will not be generated if the operator is not defined for T

T / X must be well defined Arithmetic assignment operator

This method is implemented as a template for two reasons:

  • So that it will work with a variety of operands
  • So that a stub will not be generated if the operator is not defined for T

T % X must be well defined Returns the CLIPS library type of this value

References m_clips_type.

Referenced by set(), set_type(), and CLIPS::value_to_data_object_rawenv().

Member Data Documentation

◆ m_clips_type

Type CLIPS::Value::m_clips_type
protected

◆ m_signal_changed

sigc::signal<void> CLIPS::Value::m_signal_changed
protected

Signal emitted when underlying data is changed.

Referenced by set(), set(), set(), set(), and signal_changed().

◆ m_value

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(), set(), set(), set_type(), and size().


The documentation for this class was generated from the following files:

Generated on Fri Jan 19 2024 00:00:00 for clipsmm by doxygen 1.10.0