clipsmm - C++ CLIPS Interface Library

clipsmm logo

CLIPS::Environment Class Reference

#include <environment.h>

Inheritance diagram for CLIPS::Environment:

Inheritance graph
[legend]

List of all members.

Classes

struct  Job
 Encapsulates the concept of a CLIPS job. More...

Public Types

typedef CLIPSPointer< Environmentpointer

Public Member Functions

 Environment ()
 ~Environment ()
bool batch_evaluate (const std::string &filename)
 Evaluates a series of commands in the specified file.
bool binary_load (const std::string &filename)
 Loads a binary image of constructs into the CLIPS data base.
bool binary_save (const std::string &filename)
 Saves a binary image of constructs from the CLIPS data base.
bool build (const std::string &construct)
 Allows a construct to be defined.
void clear ()
 Clears the environment.
Values evaluate (const std::string &expression)
 Evaluates and expression and returns a vector of the results.
Values function (const std::string &function_name, const std::string &arguments=std::string())
 Evaluates a CLIPS function.
int load (const std::string &filename)
 Loads a set of constructs into the CLIPS data base.
void reset ()
 Resets the CLIPS environment.
bool save (const std::string &filename)
 Saves a set of constructs to the specified file.
bool auto_float_dividend_enabled ()
 Returns the current state of the auto-float dividend behavior.
bool use_auto_float_dividend (bool use=true)
 Sets the auto-float dividend behavior.
bool dynamic_constraint_checking_enabled ()
 Returns the current state of the dynamic constraint checking behavior.
bool use_dynamic_constraint_checking (bool use=true)
 Sets the dynamic constraint checking behavior.
bool sequence_operator_recognition_enabled ()
 Returns the current state of the sequence operator recognition behavior.
bool use_sequence_operator_recognition (bool use=true)
 Sets the sequence operator recognition behavior.
bool static_constraint_checking_enabled ()
 Returns the current state of the static constraint checking behavior.
bool use_static_constraint_checking (bool use=true)
 Sets the static constraint checking behavior.
bool fact_duplication_enabled ()
 Returns the current state of the fact duplication behavior.
bool use_fact_duplication (bool use=true)
 Sets the static constraint checking behavior.
bool incremental_reset_enabled ()
bool use_incremental_reset (bool use=true)
bool global_reset_enable ()
bool use_global_reset (bool use=true)
bool is_dribble_active ()
 Determines if the storing of dribble information is active.
bool dribble_off ()
 Turns off the storing of dribble information.
bool dribble_on (const std::string &dribble_file)
 Allows the dribble function of CLIPS to be turned on.
int is_watched (const std::string &item)
 Determine if an item is being watched.
bool watch (const std::string &item)
bool unwatch (const std::string &item)
void set_as_current ()
Fact::pointer assert_fact (const std::string &factstring)
void clear_focus_stack ()
DefaultFacts::pointer get_default_facts (const std::string &default_facts_name)
 TODO Facts.
std::vector< std::string > get_default_facts_names ()
 Gets a list of default facts names from all modules.
std::vector< std::string > get_default_facts_names (const Module &module)
 Gets a list of default facts names from a specific module.
std::vector< std::string > get_default_facts_names (Module::pointer module)
 Gets a list of default facts names from a specific module.
DefaultFacts::pointer get_default_facts_list_head ()
Template::pointer get_template (const std::string &template_name)
std::vector< std::string > get_template_names ()
 Gets a list of template names from all modules.
std::vector< std::string > get_template_names (const Module &module)
 Gets a list of template names from a specific module.
std::vector< std::string > get_template_names (Module::pointer module)
 Gets a list of template names from a specific module.
Template::pointer get_template_list_head ()
Rule::pointer get_rule (const std::string &rule_name)
std::vector< std::string > get_rule_names ()
 Gets a list of rule names from all modules.
std::vector< std::string > get_rule_names (const Module &module)
 Gets a list of rule names from a specific module.
std::vector< std::string > get_rule_names (Module::pointer module)
 Gets a list of rule names from a specific module.
Rule::pointer get_rule_list_head ()
void remove_rules ()
Module::pointer get_module (const std::string &module_name)
Module::pointer get_current_module ()
std::vector< std::string > get_module_names ()
Module::pointer get_module_list_head ()
void refresh_agenda ()
 Refreshes the agenda for all modules.
void refresh_agenda (const Module &module)
 Refreshes the agenda for a specific module.
void refresh_agenda (Module::pointer module)
 Refreshes the agenda for a specific module.
void reorder_agenda ()
 Reorders the agenda for all modules.
void reorder_agenda (const Module &module)
 Reorders the agenda for a specific module.
void reorder_agenda (Module::pointer module)
 Reorders the agenda for a specific module.
long int run (long int runlimit=-1)
 Allows rules to execute.
void run_threaded (long int runlimit=-1, int priority=0)
 Executes rules in a separate thread.
void join_run_thread ()
 Waits until the execution thread is finished.
sigc::signal< void, long int > signal_run ()
 Signal emitted when the rules are executed.
SalienceEvaluation get_salience_evaluation ()
 Gets the salience evaluation mode.
SalienceEvaluation set_salience_evaluation (SalienceEvaluation se)
 Sets the salience evaluation mode.
ConflictResolution get_conflict_resolution_strategy ()
 Gets the current conflict resolution strategy.
ConflictResolution set_conflict_resolution_strategy (ConflictResolution cr)
 Sets the conflict resolution strategy.
bool check_agenda_changed ()
 TODO ListDefmodules.
Module::pointer get_focused_module ()
std::vector< std::string > get_focus_stack ()
Activation::pointer get_activation_list_head ()
Global::pointer get_global (const std::string &global_name)
Global::pointer get_global_list_head ()
std::vector< std::string > get_globals_names ()
 Gets a list of global names from all modules.
std::vector< std::string > get_globals_names (const Module &module)
 Gets a list of global names from a specific module.
std::vector< std::string > get_globals_names (Module::pointer module)
 Gets a list of global names from a specific module.
bool check_globals_changed ()
Function::pointer get_function (const std::string &function_name)
Function::pointer get_function_list_head ()
std::vector< std::string > get_function_names ()
 Gets a list of function names from all modules.
std::vector< std::string > get_function_names (const Module &module)
 Gets a list of function names from a specific module.
std::vector< std::string > get_function_names (Module::pointer module)
 Gets a list of function names from a specific module.
sigc::signal< void > signal_clear ()
sigc::signal< void > signal_periodic ()
sigc::signal< void > signal_reset ()
sigc::signal< void > signal_rule_firing ()
sigc::signal< void > signal_agenda_changed ()
sigc::signal< void > signal_globals_changed ()
template<typename T_return >
bool add_function (std::string name, const sigc::slot0< T_return > &slot)
template<typename T_return , typename T_arg1 >
bool add_function (std::string name, const sigc::slot1< T_return, T_arg1 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 >
bool add_function (std::string name, const sigc::slot2< T_return, T_arg1, T_arg2 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
bool add_function (std::string name, const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
bool add_function (std::string name, const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
bool add_function (std::string name, const sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
bool add_function (std::string name, const sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &slot)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
bool add_function (std::string name, const sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &slot)
bool remove_function (std::string name)

Protected Types

typedef struct
CLIPS::Environment::Job 
Job
 Encapsulates the concept of a CLIPS job.

Protected Member Functions

void threaded_run ()
 Protected method that does the actual work.
int(* get_callback (const sigc::slot0< std::string > &slot))(void *)
template<typename T_arg1 >
int(* get_callback (const sigc::slot1< std::string, T_arg1 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 >
int(* get_callback (const sigc::slot2< std::string, T_arg1, T_arg2 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 >
int(* get_callback (const sigc::slot3< std::string, T_arg1, T_arg2, T_arg3 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
int(* get_callback (const sigc::slot4< std::string, T_arg1, T_arg2, T_arg3, T_arg4 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
int(* get_callback (const sigc::slot5< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
int(* get_callback (const sigc::slot6< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &slot))(void *)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
int(* get_callback (const sigc::slot7< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &slot))(void *)
template<typename T_return >
int(* get_callback (const sigc::slot0< T_return > &slot))(void *)
template<typename T_return , typename T_arg1 >
int(* get_callback (const sigc::slot1< T_return, T_arg1 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 >
int(* get_callback (const sigc::slot2< T_return, T_arg1, T_arg2 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
int(* get_callback (const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
int(* get_callback (const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
int(* get_callback (const sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
int(* get_callback (const sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &slot))(void *)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
int(* get_callback (const sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &slot))(void *)

Static Protected Member Functions

static void clear_callback (void *env)
static void periodic_callback (void *env)
static void reset_callback (void *env)
static void rule_firing_callback (void *end)
static void * strcallback (void *theEnv)
template<typename T_arg1 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
static void * strcallback (void *theEnv)
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
static void * strcallback (void *theEnv)
template<typename T_return >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
static T_return callback (void *theEnv)
template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
static T_return callback (void *theEnv)
static int get_arg_count (void *env)
static void * get_function_context (void *env)
static void * add_symbol (const char *s)

Protected Attributes

std::map< std::string, anym_slots
 Holds any dynamically created slots.
sigc::signal< void > m_signal_clear
sigc::signal< void > m_signal_periodic
sigc::signal< void > m_signal_reset
sigc::signal< void > m_signal_rule_firing
sigc::signal< void > m_signal_agenda_changed
sigc::signal< void > m_signal_globals_changed
Glib::Thread * m_run_thread
 A pointer to the currently running thread.
std::priority_queue< Jobm_run_queue
 A priority queue of jobs to run.
Glib::Mutex m_mutex_run_queue
 Mutex that protects access to the run queue.
Glib::Mutex m_mutex_run
 Mutex that protects against multiple executions.
Glib::Mutex m_mutex_threaded_run
 Mutex that locks when a threaded run is executing.
Glib::Mutex m_mutex_run_signal
 Mutex that protects against multiple signal emits.
sigc::signal< void, long int > m_signal_run
 Signal emitted when a job is run.

Static Protected Attributes

static std::map< void
*, Environment * > 
m_environment_map


Detailed Description

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

Member Typedef Documentation

Encapsulates the concept of a CLIPS job.

Has a priority for comparison and a runlimit

Reimplemented from CLIPS::Object.


Constructor & Destructor Documentation

CLIPS::Environment::Environment (  ) 

CLIPS::Environment::~Environment (  ) 


Member Function Documentation

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 , typename T_arg2 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot2< T_return, T_arg1, T_arg2 > &  slot 
) [inline]

template<typename T_return , typename T_arg1 >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot1< T_return, T_arg1 > &  slot 
) [inline]

template<typename T_return >
bool CLIPS::Environment::add_function ( std::string  name,
const sigc::slot0< T_return > &  slot 
) [inline]

void * CLIPS::Environment::add_symbol ( const char *  s  )  [static, protected]

Referenced by strcallback().

Fact::pointer CLIPS::Environment::assert_fact ( const std::string &  factstring  ) 

bool CLIPS::Environment::auto_float_dividend_enabled (  ) 

Returns the current state of the auto-float dividend behavior.

When enabled, the dividend of the division function is automatically converted to a floating point number.

Returns:
true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::batch_evaluate ( const std::string &  filename  ) 

Evaluates a series of commands in the specified file.

Returns:
false if an error occurred, true otherwise

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::binary_load ( const std::string &  filename  ) 

Loads a binary image of constructs into the CLIPS data base.

Returns:
false if an error occurred, true otherwise

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::binary_save ( const std::string &  filename  ) 

Saves a binary image of constructs from the CLIPS data base.

Returns:
false if an error occurred, true on success

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::build ( const std::string &  construct  ) 

Allows a construct to be defined.

Returns:
false if the construct could not be parsed, true on success

References CLIPS::Object::m_cobj.

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 >
static T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
T_return CLIPS::Environment::callback ( void *  theEnv  )  [inline, static, protected]

bool CLIPS::Environment::check_agenda_changed (  ) 

TODO ListDefmodules.

Checks whether the agenda has changed and emits the agenda changed signal if it has. The agenda does not include any callbacks when the agenda is changed. This method returns true if the agenda has changed and emits the agenda changed signal.

References CLIPS::Object::m_cobj, and m_signal_agenda_changed.

bool CLIPS::Environment::check_globals_changed (  ) 

void CLIPS::Environment::clear (  ) 

Clears the environment.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::clear_callback ( void *  env  )  [static, protected]

References m_environment_map.

Referenced by Environment().

void CLIPS::Environment::clear_focus_stack (  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::dribble_off (  ) 

Turns off the storing of dribble information.

Returns:
false if an error occurred closing the file; true on success.

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::dribble_on ( const std::string &  dribble_file  ) 

Allows the dribble function of CLIPS to be turned on.

Returns:
false if an error occurred opening the file; true on success.

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::dynamic_constraint_checking_enabled (  ) 

Returns the current state of the dynamic constraint checking behavior.

When enabled, slot values for newly created data objects are checked for constraint violations.

Returns:
true if enabled, false if disabled

References CLIPS::Object::m_cobj.

Values CLIPS::Environment::evaluate ( const std::string &  expression  ) 

Evaluates and expression and returns a vector of the results.

If the expression could not be evaluated a zero-length vector is returned.

References CLIPS::data_object_to_values(), and CLIPS::Object::m_cobj.

bool CLIPS::Environment::fact_duplication_enabled (  ) 

Returns the current state of the fact duplication behavior.

When disabled, asserting a duplicate of a fact in the fact-list will result in no effect. When enabled, a duplicate fact is asserted with a new fact-index. Default is disabled.

Returns:
true if enabled, false if disabled

References CLIPS::Object::m_cobj.

Values CLIPS::Environment::function ( const std::string &  function_name,
const std::string &  arguments = std::string() 
)

Evaluates a CLIPS function.

If the function could not be evaluated a zero-length vector is returned.

References CLIPS::data_object_to_values(), and CLIPS::Object::m_cobj.

Referenced by get_function_list_head().

Activation::pointer CLIPS::Environment::get_activation_list_head (  ) 

int CLIPS::Environment::get_arg_count ( void *  env  )  [static, protected]

Referenced by callback(), and strcallback().

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
int( * CLIPS::Environment::get_callback ( const sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
int( * CLIPS::Environment::get_callback ( const sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
int( * CLIPS::Environment::get_callback ( const sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
int( * CLIPS::Environment::get_callback ( const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 , typename T_arg3 >
int( * CLIPS::Environment::get_callback ( const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 , typename T_arg2 >
int( * CLIPS::Environment::get_callback ( const sigc::slot2< T_return, T_arg1, T_arg2 > &  slot  )  [inline, protected]

template<typename T_return , typename T_arg1 >
int( * CLIPS::Environment::get_callback ( const sigc::slot1< T_return, T_arg1 > &  slot  )  [inline, protected]

template<typename T_return >
int( * CLIPS::Environment::get_callback ( const sigc::slot0< T_return > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
int( * CLIPS::Environment::get_callback ( const sigc::slot7< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
int( * CLIPS::Environment::get_callback ( const sigc::slot6< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
int( * CLIPS::Environment::get_callback ( const sigc::slot5< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
int( * CLIPS::Environment::get_callback ( const sigc::slot4< std::string, T_arg1, T_arg2, T_arg3, T_arg4 > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 >
int( * CLIPS::Environment::get_callback ( const sigc::slot3< std::string, T_arg1, T_arg2, T_arg3 > &  slot  )  [inline, protected]

template<typename T_arg1 , typename T_arg2 >
int( * CLIPS::Environment::get_callback ( const sigc::slot2< std::string, T_arg1, T_arg2 > &  slot  )  [inline, protected]

template<typename T_arg1 >
int( * CLIPS::Environment::get_callback ( const sigc::slot1< std::string, T_arg1 > &  slot  )  [inline, protected]

int( * CLIPS::Environment::get_callback ( const sigc::slot0< std::string > &  slot  )  [inline, protected]

Referenced by add_function().

ConflictResolution CLIPS::Environment::get_conflict_resolution_strategy (  ) 

Gets the current conflict resolution strategy.

References CLIPS::Object::m_cobj.

Module::pointer CLIPS::Environment::get_current_module (  ) 

DefaultFacts::pointer CLIPS::Environment::get_default_facts ( const std::string &  default_facts_name  ) 

DefaultFacts::pointer CLIPS::Environment::get_default_facts_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_default_facts_names ( Module::pointer  module  ) 

Gets a list of default facts names from a specific module.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_default_facts_names ( const Module module  ) 

Gets a list of default facts names from a specific module.

References CLIPS::Object::cobj(), CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_default_facts_names (  ) 

Gets a list of default facts names from all modules.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_focus_stack (  ) 

Module::pointer CLIPS::Environment::get_focused_module (  ) 

Function::pointer CLIPS::Environment::get_function ( const std::string &  function_name  ) 

void * CLIPS::Environment::get_function_context ( void *  env  )  [static, protected]

Referenced by callback(), and strcallback().

Function::pointer CLIPS::Environment::get_function_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_function_names ( Module::pointer  module  ) 

Gets a list of function names from a specific module.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_function_names ( const Module module  ) 

Gets a list of function names from a specific module.

References CLIPS::Object::cobj(), CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_function_names (  ) 

Gets a list of function names from all modules.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

Global::pointer CLIPS::Environment::get_global ( const std::string &  global_name  ) 

Global::pointer CLIPS::Environment::get_global_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_globals_names ( Module::pointer  module  ) 

Gets a list of global names from a specific module.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_globals_names ( const Module module  ) 

Gets a list of global names from a specific module.

References CLIPS::Object::cobj(), CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_globals_names (  ) 

Gets a list of global names from all modules.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

Module::pointer CLIPS::Environment::get_module ( const std::string &  module_name  ) 

Module::pointer CLIPS::Environment::get_module_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_module_names (  ) 

Rule::pointer CLIPS::Environment::get_rule ( const std::string &  rule_name  ) 

Rule::pointer CLIPS::Environment::get_rule_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_rule_names ( Module::pointer  module  ) 

Gets a list of rule names from a specific module.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_rule_names ( const Module module  ) 

Gets a list of rule names from a specific module.

References CLIPS::Object::cobj(), CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_rule_names (  ) 

Gets a list of rule names from all modules.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

SalienceEvaluation CLIPS::Environment::get_salience_evaluation (  ) 

Gets the salience evaluation mode.

References CLIPS::Object::m_cobj.

Template::pointer CLIPS::Environment::get_template ( const std::string &  template_name  ) 

Template::pointer CLIPS::Environment::get_template_list_head (  ) 

std::vector< std::string > CLIPS::Environment::get_template_names ( Module::pointer  module  ) 

Gets a list of template names from a specific module.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_template_names ( const Module module  ) 

Gets a list of template names from a specific module.

References CLIPS::Object::cobj(), CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

std::vector< std::string > CLIPS::Environment::get_template_names (  ) 

Gets a list of template names from all modules.

References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.

bool CLIPS::Environment::global_reset_enable (  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::incremental_reset_enabled (  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::is_dribble_active (  ) 

Determines if the storing of dribble information is active.

Returns:
true if dribbling is active, false if it is inactive

References CLIPS::Object::m_cobj.

int CLIPS::Environment::is_watched ( const std::string &  item  ) 

Determine if an item is being watched.

Parameters:
item must be one of the following strings: facts, rules, activations, focus, compilations, statistics, globals, instances, slots, messages, message-handlers, generic-functions, method, or deffunctions.
Returns:
1 if the item is watched, 0 if the item is not watched, -1 if the item doesn't exist

References CLIPS::Object::m_cobj.

void CLIPS::Environment::join_run_thread (  ) 

Waits until the execution thread is finished.

References m_mutex_run_queue, m_mutex_threaded_run, and m_run_thread.

int CLIPS::Environment::load ( const std::string &  filename  ) 

Loads a set of constructs into the CLIPS data base.

Returns:
Zero if the file couldn’t be opened, -1 if the file was opened but an error occurred while loading, and 1 if the file was opened and no errors occurred while loading.
If syntactic errors are in the constructs, load still will attempt to read the entire file and error notices will be sent to werror.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::periodic_callback ( void *  env  )  [static, protected]

References m_environment_map.

Referenced by Environment().

void CLIPS::Environment::refresh_agenda ( Module::pointer  module  ) 

Refreshes the agenda for a specific module.

Recomputes the salience values for all activations on the agenda and then reorders the agenda.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::refresh_agenda ( const Module module  ) 

Refreshes the agenda for a specific module.

Recomputes the salience values for all activations on the agenda and then reorders the agenda.

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

void CLIPS::Environment::refresh_agenda (  ) 

Refreshes the agenda for all modules.

Recomputes the salience values for all activations on the agenda and then reorders the agenda.

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::remove_function ( std::string  name  ) 

References CLIPS::Object::m_cobj, and m_slots.

void CLIPS::Environment::remove_rules (  ) 

References CLIPS::Object::m_cobj.

void CLIPS::Environment::reorder_agenda ( Module::pointer  module  ) 

Reorders the agenda for a specific module.

Reorders the agenda based on the current conflict resolution strategy and current activation saliences.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::reorder_agenda ( const Module module  ) 

Reorders the agenda for a specific module.

Reorders the agenda based on the current conflict resolution strategy and current activation saliences.

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

void CLIPS::Environment::reorder_agenda (  ) 

Reorders the agenda for all modules.

Reorders the agenda based on the current conflict resolution strategy and current activation saliences.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::reset (  ) 

Resets the CLIPS environment.

References CLIPS::Object::m_cobj.

void CLIPS::Environment::reset_callback ( void *  env  )  [static, protected]

References m_environment_map.

Referenced by Environment().

void CLIPS::Environment::rule_firing_callback ( void *  end  )  [static, protected]

References m_environment_map.

Referenced by Environment().

long int CLIPS::Environment::run ( long int  runlimit = -1  ) 

Allows rules to execute.

Returns:
The number of rules that fired
Parameters:
runlimit How many rules should fire If runlimit is negative, rules will fire until the agenda is empty.
If a threaded execution is active, this call will block until the threaded execution queue is empty.

References CLIPS::Object::m_cobj, m_mutex_run, m_mutex_run_signal, and m_signal_run.

void CLIPS::Environment::run_threaded ( long int  runlimit = -1,
int  priority = 0 
)

Executes rules in a separate thread.

If an execution thread is already running, the job will be added to the run queue at the priority level specified. The higher the priority, the higher in the queue. After each execution, the run queue is checked and the next highest priority job is executed.

If the normal run() method is executing, the execution thread will be created, but will block until the previously executing call to run() is completed. After run() completes, the execution thread will unblock and start execution.

The methods of environment are not threadsafe yet. This is just an early look at threading, but making it threadsafe will not be too difficult. For now, to be safe, join the run thread before changing anything in the environment.

References m_mutex_run, m_mutex_run_queue, m_mutex_threaded_run, m_run_queue, m_run_thread, and threaded_run().

bool CLIPS::Environment::save ( const std::string &  filename  ) 

Saves a set of constructs to the specified file.

Returns:
false if an error occurred, true on success

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::sequence_operator_recognition_enabled (  ) 

Returns the current state of the sequence operator recognition behavior.

When enabled, multifield variables are expanded and passed as separate arguments in the function call.

Returns:
true if enabled, false if disabled

References CLIPS::Object::m_cobj.

void CLIPS::Environment::set_as_current (  ) 

References CLIPS::Object::m_cobj.

ConflictResolution CLIPS::Environment::set_conflict_resolution_strategy ( ConflictResolution  cr  ) 

Sets the conflict resolution strategy.

Returns:
the old conflict resolution strategy

References CLIPS::Object::m_cobj.

SalienceEvaluation CLIPS::Environment::set_salience_evaluation ( SalienceEvaluation  se  ) 

Sets the salience evaluation mode.

Returns:
the old salience evaluation mode

References CLIPS::Object::m_cobj.

sigc::signal< void > CLIPS::Environment::signal_agenda_changed (  ) 

sigc::signal< void > CLIPS::Environment::signal_clear (  ) 

References m_signal_clear.

sigc::signal< void > CLIPS::Environment::signal_globals_changed (  ) 

sigc::signal< void > CLIPS::Environment::signal_periodic (  ) 

References m_signal_periodic.

sigc::signal< void > CLIPS::Environment::signal_reset (  ) 

References m_signal_reset.

sigc::signal< void > CLIPS::Environment::signal_rule_firing (  ) 

References m_signal_rule_firing.

sigc::signal< void, long int > CLIPS::Environment::signal_run (  ) 

Signal emitted when the rules are executed.

The signal emits the number of rules executed.

References m_signal_run.

bool CLIPS::Environment::static_constraint_checking_enabled (  ) 

Returns the current state of the static constraint checking behavior.

When enabled, constraint violations are checked when function calls and constructs are parsed.

Returns:
true if enabled, false if disabled

References CLIPS::Object::m_cobj.

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 , typename T_arg2 , typename T_arg3 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 , typename T_arg2 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

template<typename T_arg1 >
static void* CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

void * CLIPS::Environment::strcallback ( void *  theEnv  )  [inline, static, protected]

void CLIPS::Environment::threaded_run (  )  [protected]

Protected method that does the actual work.

References CLIPS::Object::m_cobj, m_mutex_run, m_mutex_run_queue, m_mutex_run_signal, m_mutex_threaded_run, m_run_queue, and m_signal_run.

Referenced by run_threaded().

bool CLIPS::Environment::unwatch ( const std::string &  item  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_auto_float_dividend ( bool  use = true  ) 

Sets the auto-float dividend behavior.

When enabled, the dividend of the division function is automatically converted to a floating point number. Default is enabled.

Returns:
the new value for the behavior; true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_dynamic_constraint_checking ( bool  use = true  ) 

Sets the dynamic constraint checking behavior.

When enabled, slot values for newly created data objects are checked for constraint violations. Default is disabled.

Returns:
the new value for the behavior; true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_fact_duplication ( bool  use = true  ) 

Sets the static constraint checking behavior.

When enabled, constraint violations are checked when function calls and constructs are parsed.

Returns:
the new value for the behavior; true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_global_reset ( bool  use = true  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_incremental_reset ( bool  use = true  ) 

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_sequence_operator_recognition ( bool  use = true  ) 

Sets the sequence operator recognition behavior.

When enabled, multifield variables are expanded and passed as separate arguments in the function call. Default is disabled.

Returns:
the new value for the behavior; true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::use_static_constraint_checking ( bool  use = true  ) 

Sets the static constraint checking behavior.

When enabled, constraint violations are checked when function calls and constructs are parsed.

Returns:
the new value for the behavior; true if enabled, false if disabled

References CLIPS::Object::m_cobj.

bool CLIPS::Environment::watch ( const std::string &  item  ) 

References CLIPS::Object::m_cobj.


Member Data Documentation

std::map< void *, Environment * > CLIPS::Environment::m_environment_map [static, protected]

Glib::Mutex CLIPS::Environment::m_mutex_run [protected]

Mutex that protects against multiple executions.

Referenced by run(), run_threaded(), and threaded_run().

Glib::Mutex CLIPS::Environment::m_mutex_run_queue [protected]

Mutex that protects access to the run queue.

Referenced by join_run_thread(), run_threaded(), and threaded_run().

Glib::Mutex CLIPS::Environment::m_mutex_run_signal [protected]

Mutex that protects against multiple signal emits.

Referenced by run(), and threaded_run().

Mutex that locks when a threaded run is executing.

Referenced by join_run_thread(), run_threaded(), and threaded_run().

std::priority_queue<Job> CLIPS::Environment::m_run_queue [protected]

A priority queue of jobs to run.

Referenced by run_threaded(), and threaded_run().

Glib::Thread* CLIPS::Environment::m_run_thread [protected]

A pointer to the currently running thread.

Referenced by join_run_thread(), and run_threaded().

sigc::signal<void> CLIPS::Environment::m_signal_agenda_changed [protected]

sigc::signal<void> CLIPS::Environment::m_signal_clear [protected]

Referenced by signal_clear().

sigc::signal<void> CLIPS::Environment::m_signal_globals_changed [protected]

sigc::signal<void> CLIPS::Environment::m_signal_periodic [protected]

Referenced by signal_periodic().

sigc::signal<void> CLIPS::Environment::m_signal_reset [protected]

Referenced by signal_reset().

sigc::signal<void> CLIPS::Environment::m_signal_rule_firing [protected]

Referenced by signal_rule_firing().

sigc::signal<void, long int> CLIPS::Environment::m_signal_run [protected]

Signal emitted when a job is run.

Referenced by run(), signal_run(), and threaded_run().

std::map<std::string,any> CLIPS::Environment::m_slots [protected]

Holds any dynamically created slots.

Type any is used to hold different smart pointers, each of which hold different slots. When a slot is undefined, or at destruction when the map goes out of scope, the memory is reclaimed through the smart pointer.

Referenced by add_function(), and remove_function().


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

Generated on Wed Jul 29 12:04:14 2009 for clipsmm by doxygen 1.5.8