clipsmm - C++ CLIPS Interface Library

clipsmm logo
Public Types | Public Member Functions | Static Public Member Functions
CLIPS::Fact Class Reference

#include <fact.h>

Inheritance diagram for CLIPS::Fact:
Inheritance graph
[legend]

List of all members.

Public Types

typedef CLIPSPointer< Factpointer

Public Member Functions

 Fact (Environment &environment, void *cobj=NULL)
 ~Fact ()
bool assign_slot_defaults ()
 Assigns default values to a fact.
Template::pointer get_template ()
 Returns the template associated with a fact.
bool exists ()
 Indicates whether a fact is still in the fact list or has been retracted.
long int index ()
 Returns the fact index of a fact.
std::vector< std::stringslot_names ()
 Returns the slot names associated with this fact.
Values slot_value (const std::string &slot_name)
 Return the values contained within a slot.
Fact::pointer next ()
 Returns the next fact in the fact list.
bool set_slot (const std::string &slot_name, const Values &values)
 Sets the named slot to a specific value or values.
bool set_slot (const std::string &slot_name, const Value &value)
 Sets the named slot to a specific value or values.
bool retract ()
 Retracts a fact from the fact list.

Static Public Member Functions

static Fact::pointer create (Environment &environment, void *cobj=NULL)

Detailed Description

Author:
Rick L. Vinyard, Jr. <rvinyard@cs.nmsu.edu>

Member Typedef Documentation

typedef CLIPSPointer<Fact> CLIPS::Fact::pointer

Reimplemented from CLIPS::Object.


Constructor & Destructor Documentation

CLIPS::Fact::Fact ( Environment environment,
void *  cobj = NULL 
)
CLIPS::Fact::~Fact ( )

Member Function Documentation

bool CLIPS::Fact::assign_slot_defaults ( )

Assigns default values to a fact.

Returns:
true if the default values were successfully set, false otherwise

References CLIPS::Object::m_cobj, CLIPS::EnvironmentObject::m_environment, and CLIPS::Object::cobj().

Fact::pointer CLIPS::Fact::create ( Environment environment,
void *  cobj = NULL 
) [static]
bool CLIPS::Fact::exists ( )

Indicates whether a fact is still in the fact list or has been retracted.

Returns:
true if the fact is still in the fact list, false otherwise

References CLIPS::Object::m_cobj, CLIPS::EnvironmentObject::m_environment, and CLIPS::Object::cobj().

Referenced by next().

Template::pointer CLIPS::Fact::get_template ( )

Returns the template associated with a fact.

References CLIPS::Object::m_cobj, CLIPS::EnvironmentObject::m_environment, CLIPS::Object::cobj(), and create().

long int CLIPS::Fact::index ( )

Returns the fact index of a fact.

Returns:
the index of the fact or -1 if this fact object is uninitialized

References CLIPS::Object::m_cobj, CLIPS::EnvironmentObject::m_environment, and CLIPS::Object::cobj().

Fact::pointer CLIPS::Fact::next ( )

Returns the next fact in the fact list.

References CLIPS::Object::m_cobj, exists(), CLIPS::EnvironmentObject::m_environment, CLIPS::Object::cobj(), and create().

bool CLIPS::Fact::retract ( )

Retracts a fact from the fact list.

References CLIPS::Object::m_cobj, CLIPS::EnvironmentObject::m_environment, and CLIPS::Object::cobj().

bool CLIPS::Fact::set_slot ( const std::string slot_name,
const Values values 
)

Sets the named slot to a specific value or values.

References CLIPS::value_to_data_object(), CLIPS::EnvironmentObject::m_environment, CLIPS::Object::m_cobj, and CLIPS::Object::cobj().

bool CLIPS::Fact::set_slot ( const std::string slot_name,
const Value value 
)

Sets the named slot to a specific value or values.

References CLIPS::value_to_data_object(), CLIPS::EnvironmentObject::m_environment, CLIPS::Object::m_cobj, and CLIPS::Object::cobj().

std::vector< std::string > CLIPS::Fact::slot_names ( )
Values CLIPS::Fact::slot_value ( const std::string slot_name)

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

Generated on Tue Feb 7 2012 19:15:21 for clipsmm by doxygen 1.7.5