#include <environment.h>
Classes | |
struct | Job |
Encapsulates the concept of a CLIPS job. More... | |
Public Types | |
typedef CLIPSPointer< Environment > | pointer |
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, any > | m_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< Job > | m_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 |
typedef struct CLIPS::Environment::Job CLIPS::Environment::Job [protected] |
Encapsulates the concept of a CLIPS job.
Has a priority for comparison and a runlimit
typedef CLIPSPointer<Environment> CLIPS::Environment::pointer |
Reimplemented from CLIPS::Object.
CLIPS::Environment::Environment | ( | ) |
CLIPS::Environment::~Environment | ( | ) |
References CLIPS::Object::m_cobj, and m_environment_map.
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] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
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] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
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] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
bool CLIPS::Environment::add_function | ( | std::string | name, | |
const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > & | slot | |||
) | [inline] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
bool CLIPS::Environment::add_function | ( | std::string | name, | |
const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > & | slot | |||
) | [inline] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
bool CLIPS::Environment::add_function | ( | std::string | name, | |
const sigc::slot2< T_return, T_arg1, T_arg2 > & | slot | |||
) | [inline] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
bool CLIPS::Environment::add_function | ( | std::string | name, | |
const sigc::slot1< T_return, T_arg1 > & | slot | |||
) | [inline] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
bool CLIPS::Environment::add_function | ( | std::string | name, | |
const sigc::slot0< T_return > & | slot | |||
) | [inline] |
References EnvDefineFunction2WithContext(), get_callback(), CLIPS::Object::m_cobj, and m_slots.
void * CLIPS::Environment::add_symbol | ( | const char * | s | ) | [static, protected] |
Referenced by strcallback().
Fact::pointer CLIPS::Environment::assert_fact | ( | const std::string & | factstring | ) |
References CLIPS::Fact::create(), and CLIPS::Object::m_cobj.
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.
References CLIPS::Object::m_cobj.
bool CLIPS::Environment::batch_evaluate | ( | const std::string & | filename | ) |
Evaluates a series of commands in the specified file.
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.
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.
References CLIPS::Object::m_cobj.
bool CLIPS::Environment::build | ( | const std::string & | construct | ) |
Allows a construct to be defined.
References CLIPS::Object::m_cobj.
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
static T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
T_return CLIPS::Environment::callback | ( | void * | theEnv | ) | [inline, static, protected] |
References get_arg_count(), and get_function_context().
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 | ( | ) |
References CLIPS::Object::m_cobj, and m_signal_globals_changed.
void CLIPS::Environment::clear | ( | ) |
void CLIPS::Environment::clear_callback | ( | void * | env | ) | [static, protected] |
void CLIPS::Environment::clear_focus_stack | ( | ) |
References CLIPS::Object::m_cobj.
bool CLIPS::Environment::dribble_off | ( | ) |
Turns off the storing of dribble information.
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.
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.
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.
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 | ( | ) |
References CLIPS::Activation::create(), and CLIPS::Object::m_cobj.
int CLIPS::Environment::get_arg_count | ( | void * | env | ) | [static, protected] |
Referenced by callback(), and strcallback().
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] |
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] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot2< T_return, T_arg1, T_arg2 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot1< T_return, T_arg1 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot0< T_return > & | slot | ) | [inline, protected] |
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] |
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] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot5< std::string, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot4< std::string, T_arg1, T_arg2, T_arg3, T_arg4 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot3< std::string, T_arg1, T_arg2, T_arg3 > & | slot | ) | [inline, protected] |
int( * CLIPS::Environment::get_callback | ( | const sigc::slot2< std::string, T_arg1, T_arg2 > & | slot | ) | [inline, protected] |
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 | ( | ) |
Module::pointer CLIPS::Environment::get_current_module | ( | ) |
References CLIPS::Module::create(), and CLIPS::Object::m_cobj.
DefaultFacts::pointer CLIPS::Environment::get_default_facts | ( | const std::string & | default_facts_name | ) |
DefaultFacts::pointer CLIPS::Environment::get_default_facts_list_head | ( | ) |
References CLIPS::DefaultFacts::create(), and CLIPS::Object::m_cobj.
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 | ( | ) |
References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.
Module::pointer CLIPS::Environment::get_focused_module | ( | ) |
References CLIPS::Module::create(), and CLIPS::Object::m_cobj.
Function::pointer CLIPS::Environment::get_function | ( | const std::string & | function_name | ) |
References CLIPS::Function::create(), and CLIPS::Object::m_cobj.
void * CLIPS::Environment::get_function_context | ( | void * | env | ) | [static, protected] |
Referenced by callback(), and strcallback().
Function::pointer CLIPS::Environment::get_function_list_head | ( | ) |
References CLIPS::Function::create(), function(), and CLIPS::Object::m_cobj.
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 | ) |
References CLIPS::Global::create(), and CLIPS::Object::m_cobj.
Global::pointer CLIPS::Environment::get_global_list_head | ( | ) |
References CLIPS::Global::create(), and CLIPS::Object::m_cobj.
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 | ) |
References CLIPS::Module::create(), and CLIPS::Object::m_cobj.
Module::pointer CLIPS::Environment::get_module_list_head | ( | ) |
References CLIPS::Module::create(), and CLIPS::Object::m_cobj.
std::vector< std::string > CLIPS::Environment::get_module_names | ( | ) |
References CLIPS::data_object_to_strings(), and CLIPS::Object::m_cobj.
Rule::pointer CLIPS::Environment::get_rule | ( | const std::string & | rule_name | ) |
References CLIPS::Rule::create(), and CLIPS::Object::m_cobj.
Rule::pointer CLIPS::Environment::get_rule_list_head | ( | ) |
References CLIPS::Rule::create(), and CLIPS::Object::m_cobj.
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 | ( | ) |
Template::pointer CLIPS::Environment::get_template | ( | const std::string & | template_name | ) |
References CLIPS::Template::create(), and CLIPS::Object::m_cobj.
Template::pointer CLIPS::Environment::get_template_list_head | ( | ) |
References CLIPS::Template::create(), and CLIPS::Object::m_cobj.
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.
References CLIPS::Object::m_cobj.
int CLIPS::Environment::is_watched | ( | const std::string & | item | ) |
Determine if an item is being watched.
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. |
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.
References CLIPS::Object::m_cobj.
void CLIPS::Environment::periodic_callback | ( | void * | env | ) | [static, protected] |
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 | ( | ) |
void CLIPS::Environment::reset_callback | ( | void * | env | ) | [static, protected] |
void CLIPS::Environment::rule_firing_callback | ( | void * | end | ) | [static, protected] |
long int CLIPS::Environment::run | ( | long int | runlimit = -1 |
) |
Allows rules to execute.
runlimit | How many rules should fire If runlimit is negative, rules will fire until the agenda 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.
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.
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.
References CLIPS::Object::m_cobj.
SalienceEvaluation CLIPS::Environment::set_salience_evaluation | ( | SalienceEvaluation | se | ) |
Sets the salience evaluation mode.
References CLIPS::Object::m_cobj.
sigc::signal< void > CLIPS::Environment::signal_agenda_changed | ( | ) |
References m_signal_agenda_changed.
sigc::signal< void > CLIPS::Environment::signal_clear | ( | ) |
References m_signal_clear.
sigc::signal< void > CLIPS::Environment::signal_globals_changed | ( | ) |
References m_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.
References CLIPS::Object::m_cobj.
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
static void* CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
void * CLIPS::Environment::strcallback | ( | void * | theEnv | ) | [inline, static, protected] |
References add_symbol(), get_arg_count(), and get_function_context().
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.
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.
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.
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.
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.
References CLIPS::Object::m_cobj.
bool CLIPS::Environment::watch | ( | const std::string & | item | ) |
References CLIPS::Object::m_cobj.
std::map< void *, Environment * > CLIPS::Environment::m_environment_map [static, protected] |
Referenced by clear_callback(), Environment(), periodic_callback(), reset_callback(), rule_firing_callback(), and ~Environment().
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] |
Glib::Mutex CLIPS::Environment::m_mutex_threaded_run [protected] |
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] |
Glib::Thread* CLIPS::Environment::m_run_thread [protected] |
sigc::signal<void> CLIPS::Environment::m_signal_agenda_changed [protected] |
Referenced by check_agenda_changed(), and signal_agenda_changed().
sigc::signal<void> CLIPS::Environment::m_signal_clear [protected] |
Referenced by signal_clear().
sigc::signal<void> CLIPS::Environment::m_signal_globals_changed [protected] |
Referenced by check_globals_changed(), and signal_globals_changed().
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] |
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().