#include <environment.h>
Classes | |
struct | Job |
Encapsulates the concept of a CLIPS job. More... | |
Public Types | |
typedef CLIPSPointer< Environment > | pointer |
![]() | |
typedef CLIPSPointer< Object > | pointer |
Public Member Functions | |
Environment () | |
~Environment () | |
bool | batch_evaluate (const std::string &filename) |
Evaluates a series of commands in the specified file. More... | |
bool | binary_load (const std::string &filename) |
Loads a binary image of constructs into the CLIPS data base. More... | |
bool | binary_save (const std::string &filename) |
Saves a binary image of constructs from the CLIPS data base. More... | |
bool | build (const std::string &construct) |
Allows a construct to be defined. More... | |
void | clear () |
Clears the environment. More... | |
Values | evaluate (const std::string &expression) |
Evaluates and expression and returns a vector of the results. More... | |
Values | function (const std::string &function_name, const std::string &arguments=std::string()) |
Evaluates a CLIPS function. More... | |
int | load (const std::string &filename) |
Loads a set of constructs into the CLIPS data base. More... | |
void | reset () |
Resets the CLIPS environment. More... | |
bool | save (const std::string &filename) |
Saves a set of constructs to the specified file. More... | |
bool | auto_float_dividend_enabled () |
Returns the current state of the auto-float dividend behavior. More... | |
bool | use_auto_float_dividend (bool use=true) |
Sets the auto-float dividend behavior. More... | |
bool | dynamic_constraint_checking_enabled () |
Returns the current state of the dynamic constraint checking behavior. More... | |
bool | use_dynamic_constraint_checking (bool use=true) |
Sets the dynamic constraint checking behavior. More... | |
bool | sequence_operator_recognition_enabled () |
Returns the current state of the sequence operator recognition behavior. More... | |
bool | use_sequence_operator_recognition (bool use=true) |
Sets the sequence operator recognition behavior. More... | |
bool | static_constraint_checking_enabled () |
Returns the current state of the static constraint checking behavior. More... | |
bool | use_static_constraint_checking (bool use=true) |
Sets the static constraint checking behavior. More... | |
bool | fact_duplication_enabled () |
Returns the current state of the fact duplication behavior. More... | |
bool | use_fact_duplication (bool use=true) |
Sets the static constraint checking behavior. More... | |
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. More... | |
bool | dribble_off () |
Turns off the storing of dribble information. More... | |
bool | dribble_on (const std::string &dribble_file) |
Allows the dribble function of CLIPS to be turned on. More... | |
int | is_watched (const std::string &item) |
Determine if an item is being watched. More... | |
bool | watch (const std::string &item) |
bool | unwatch (const std::string &item) |
void | set_as_current () |
Fact::pointer | assert_fact (const std::string &factstring) |
Fact::pointer | assert_fact (Fact::pointer fact) |
Fact::pointer | assert_fact_f (const char *format,...) |
void | clear_focus_stack () |
Fact::pointer | get_facts () |
TODO Facts. More... | |
DefaultFacts::pointer | get_default_facts (const std::string &default_facts_name) |
std::vector< std::string > | get_default_facts_names () |
Gets a list of default facts names from all modules. More... | |
std::vector< std::string > | get_default_facts_names (const Module &module) |
Gets a list of default facts names from a specific module. More... | |
std::vector< std::string > | get_default_facts_names (Module::pointer module) |
Gets a list of default facts names from a specific module. More... | |
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. More... | |
std::vector< std::string > | get_template_names (const Module &module) |
Gets a list of template names from a specific module. More... | |
std::vector< std::string > | get_template_names (Module::pointer module) |
Gets a list of template names from a specific module. More... | |
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. More... | |
std::vector< std::string > | get_rule_names (const Module &module) |
Gets a list of rule names from a specific module. More... | |
std::vector< std::string > | get_rule_names (Module::pointer module) |
Gets a list of rule names from a specific module. More... | |
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. More... | |
void | refresh_agenda (const Module &module) |
Refreshes the agenda for a specific module. More... | |
void | refresh_agenda (Module::pointer module) |
Refreshes the agenda for a specific module. More... | |
void | reorder_agenda () |
Reorders the agenda for all modules. More... | |
void | reorder_agenda (const Module &module) |
Reorders the agenda for a specific module. More... | |
void | reorder_agenda (Module::pointer module) |
Reorders the agenda for a specific module. More... | |
long int | run (long int runlimit=-1) |
Allows rules to execute. More... | |
void | run_threaded (long int runlimit=-1, int priority=0) |
Executes rules in a separate thread. More... | |
void | join_run_thread () |
Waits until the execution thread is finished. More... | |
sigc::signal< void, long int > | signal_run () |
Signal emitted when the rules are executed. More... | |
SalienceEvaluation | get_salience_evaluation () |
Gets the salience evaluation mode. More... | |
SalienceEvaluation | set_salience_evaluation (SalienceEvaluation se) |
Sets the salience evaluation mode. More... | |
ConflictResolution | get_conflict_resolution_strategy () |
Gets the current conflict resolution strategy. More... | |
ConflictResolution | set_conflict_resolution_strategy (ConflictResolution cr) |
Sets the conflict resolution strategy. More... | |
bool | check_agenda_changed () |
TODO ListDefmodules. More... | |
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. More... | |
std::vector< std::string > | get_globals_names (const Module &module) |
Gets a list of global names from a specific module. More... | |
std::vector< std::string > | get_globals_names (Module::pointer module) |
Gets a list of global names from a specific module. More... | |
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. More... | |
std::vector< std::string > | get_function_names (const Module &module) |
Gets a list of function names from a specific module. More... | |
std::vector< std::string > | get_function_names (Module::pointer module) |
Gets a list of function names from a specific module. More... | |
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) |
![]() | |
Object (void *cobj=NULL) | |
~Object () | |
void * | cobj () const |
Returns a pointer to the underlying CLIPS C object. More... | |
Protected Types | |
typedef struct CLIPS::Environment::Job | Job |
Encapsulates the concept of a CLIPS job. More... | |
Protected Member Functions | |
void | threaded_run () |
Protected method that does the actual work. More... | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 > | |
char * | get_function_restriction (std::string &name) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 > | |
char * | get_function_restriction (std::string &name) |
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 void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 > | |
static void | callback_multifield (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 > | |
static void | callback_multifield (void *theEnv, void *rv) |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 > | |
static void | callback_unknown (void *theEnv, void *rv) |
template<typename T_arg1 , typename T_arg2 , typename T_arg3 , typename T_arg4 , typename T_arg5 , typename T_arg6 , typename T_arg7 > | |
static void | callback_unknown (void *theEnv, void *rv) |
static int | get_arg_count (void *env) |
static void * | get_function_context (void *env) |
static void | set_return_values (void *env, void *rv, const Values &v) |
static void | set_return_value (void *env, void *rv, const Value &v) |
static void * | add_symbol (void *env, const char *s) |
Protected Attributes | |
std::map< std::string, any > | m_slots |
Holds any dynamically created slots. More... | |
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. More... | |
std::priority_queue< Job > | m_run_queue |
A priority queue of jobs to run. More... | |
Glib::Mutex | m_mutex_run_queue |
Mutex that protects access to the run queue. More... | |
Glib::Mutex | m_mutex_run |
Mutex that protects against multiple executions. More... | |
Glib::Mutex | m_mutex_threaded_run |
Mutex that locks when a threaded run is executing. More... | |
Glib::Mutex | m_mutex_run_signal |
Mutex that protects against multiple signal emits. More... | |
sigc::signal< void, long int > | m_signal_run |
Signal emitted when a job is run. More... | |
std::map< std::string, char * > | m_func_restr |
Map from function name to restrictions. More... | |
int(*)(void *) | get_callback (const sigc::slot0< std::string > &slot) |
![]() | |
void * | m_cobj |
The underlying CLIPS C object. More... | |
Static Protected Attributes | |
static std::map< void *, Environment * > | m_environment_map |
|
protected |
Encapsulates the concept of a CLIPS job.
Has a priority for comparison and a runlimit
CLIPS::Environment::Environment | ( | ) |
CLIPS::Environment::~Environment | ( | ) |
|
inline |
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
inline |
References EnvDefineFunction2WithContext(), get_callback, CLIPS::Object::m_cobj, and m_slots.
|
staticprotected |
Referenced by strcallback().
Fact::pointer CLIPS::Environment::assert_fact | ( | const std::string & | factstring | ) |
Fact::pointer CLIPS::Environment::assert_fact | ( | Fact::pointer | fact | ) |
Fact::pointer CLIPS::Environment::assert_fact_f | ( | const char * | format, |
... | |||
) |
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.
bool CLIPS::Environment::batch_evaluate | ( | const std::string & | filename | ) |
Evaluates a series of commands in the specified file.
bool CLIPS::Environment::binary_load | ( | const std::string & | filename | ) |
Loads a binary image of constructs into the CLIPS data base.
bool CLIPS::Environment::binary_save | ( | const std::string & | filename | ) |
Saves a binary image of constructs from the CLIPS data base.
bool CLIPS::Environment::build | ( | const std::string & | construct | ) |
Allows a construct to be defined.
|
inlinestaticprotected |
References get_arg_count(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References get_arg_count(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_values().
|
inlinestaticprotected |
References get_arg_count(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
|
inlinestaticprotected |
References get_arg_count(), CLIPS::get_argument(), get_function_context(), and set_return_value().
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.
bool CLIPS::Environment::check_globals_changed | ( | ) |
void CLIPS::Environment::clear | ( | ) |
Clears the environment.
|
staticprotected |
void CLIPS::Environment::clear_focus_stack | ( | ) |
bool CLIPS::Environment::dribble_off | ( | ) |
Turns off the storing of dribble information.
bool CLIPS::Environment::dribble_on | ( | const std::string & | dribble_file | ) |
Allows the dribble function of CLIPS to be turned on.
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.
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.
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.
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.
Activation::pointer CLIPS::Environment::get_activation_list_head | ( | ) |
|
staticprotected |
Referenced by callback(), callback_multifield(), callback_unknown(), and strcallback().
ConflictResolution CLIPS::Environment::get_conflict_resolution_strategy | ( | ) |
Gets the current conflict resolution strategy.
Module::pointer CLIPS::Environment::get_current_module | ( | ) |
DefaultFacts::pointer CLIPS::Environment::get_default_facts | ( | const std::string & | default_facts_name | ) |
References CLIPS::Object::cobj(), and CLIPS::data_object_to_strings().
DefaultFacts::pointer CLIPS::Environment::get_default_facts_list_head | ( | ) |
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().
std::vector< std::string > CLIPS::Environment::get_default_facts_names | ( | const Module & | module | ) |
Gets a list of default facts names from a specific module.
std::vector< std::string > CLIPS::Environment::get_default_facts_names | ( | Module::pointer | module | ) |
Gets a list of default facts names from a specific module.
Fact::pointer CLIPS::Environment::get_facts | ( | ) |
TODO Facts.
Get facts.
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 | ) |
References CLIPS::data_object_to_strings().
|
staticprotected |
Referenced by callback(), callback_multifield(), callback_unknown(), and strcallback().
Function::pointer CLIPS::Environment::get_function_list_head | ( | ) |
References CLIPS::Object::cobj(), and CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_function_names | ( | ) |
Gets a list of function names from all modules.
References CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_function_names | ( | const Module & | module | ) |
Gets a list of function names from a specific module.
std::vector< std::string > CLIPS::Environment::get_function_names | ( | Module::pointer | module | ) |
Gets a list of function names from a specific module.
|
inlineprotected |
References m_func_restr.
Referenced by add_function().
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
|
inlineprotected |
References m_func_restr.
Global::pointer CLIPS::Environment::get_global | ( | const std::string & | global_name | ) |
References CLIPS::data_object_to_strings().
Global::pointer CLIPS::Environment::get_global_list_head | ( | ) |
References CLIPS::Object::cobj(), and CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_globals_names | ( | ) |
Gets a list of global names from all modules.
References CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_globals_names | ( | const Module & | module | ) |
Gets a list of global names from a specific module.
std::vector< std::string > CLIPS::Environment::get_globals_names | ( | Module::pointer | module | ) |
Gets a list of global names from a specific module.
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 | ( | ) |
References CLIPS::data_object_to_values().
Rule::pointer CLIPS::Environment::get_rule | ( | const std::string & | rule_name | ) |
References CLIPS::Object::cobj(), and CLIPS::data_object_to_strings().
Rule::pointer CLIPS::Environment::get_rule_list_head | ( | ) |
std::vector< std::string > CLIPS::Environment::get_rule_names | ( | ) |
Gets a list of rule names from all modules.
References CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_rule_names | ( | const Module & | module | ) |
Gets a list of rule names from a specific module.
std::vector< std::string > CLIPS::Environment::get_rule_names | ( | Module::pointer | module | ) |
Gets a list of rule names from a specific module.
SalienceEvaluation CLIPS::Environment::get_salience_evaluation | ( | ) |
Gets the salience evaluation mode.
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 | ( | ) |
Gets a list of template names from all modules.
References CLIPS::data_object_to_strings().
std::vector< std::string > CLIPS::Environment::get_template_names | ( | const Module & | module | ) |
Gets a list of template names from a specific module.
std::vector< std::string > CLIPS::Environment::get_template_names | ( | Module::pointer | module | ) |
Gets a list of template names from a specific module.
bool CLIPS::Environment::global_reset_enable | ( | ) |
bool CLIPS::Environment::incremental_reset_enabled | ( | ) |
bool CLIPS::Environment::is_dribble_active | ( | ) |
Determines if the storing of dribble information is active.
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. |
void CLIPS::Environment::join_run_thread | ( | ) |
Waits until the execution thread is finished.
int CLIPS::Environment::load | ( | const std::string & | filename | ) |
Loads a set of constructs into the CLIPS data base.
If syntactic errors are in the constructs, load still will attempt to read the entire file and error notices will be sent to werror.
|
staticprotected |
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::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.
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.
bool CLIPS::Environment::remove_function | ( | std::string | name | ) |
void CLIPS::Environment::remove_rules | ( | ) |
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.
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.
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.
void CLIPS::Environment::reset | ( | ) |
Resets the CLIPS environment.
|
staticprotected |
|
staticprotected |
References CLIPS::TYPE_FLOAT.
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. |
If a threaded execution is active, this call will block until the threaded execution queue is empty.
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.
\TODO 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.
bool CLIPS::Environment::save | ( | const std::string & | filename | ) |
Saves a set of constructs to the specified file.
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.
void CLIPS::Environment::set_as_current | ( | ) |
ConflictResolution CLIPS::Environment::set_conflict_resolution_strategy | ( | ConflictResolution | cr | ) |
Sets the conflict resolution strategy.
|
staticprotected |
Referenced by callback_unknown().
|
staticprotected |
Referenced by callback_multifield().
SalienceEvaluation CLIPS::Environment::set_salience_evaluation | ( | SalienceEvaluation | se | ) |
Sets the salience evaluation mode.
sigc::signal< void > CLIPS::Environment::signal_agenda_changed | ( | ) |
sigc::signal< void > CLIPS::Environment::signal_clear | ( | ) |
sigc::signal< void > CLIPS::Environment::signal_globals_changed | ( | ) |
sigc::signal< void > CLIPS::Environment::signal_periodic | ( | ) |
sigc::signal< void > CLIPS::Environment::signal_reset | ( | ) |
sigc::signal< void > CLIPS::Environment::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.
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.
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
inlinestaticprotected |
References add_symbol(), get_arg_count(), CLIPS::get_argument(), and get_function_context().
|
protected |
Protected method that does the actual work.
bool CLIPS::Environment::unwatch | ( | const std::string & | item | ) |
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.
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.
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.
bool CLIPS::Environment::use_global_reset | ( | bool | use = true | ) |
bool CLIPS::Environment::use_incremental_reset | ( | bool | use = true | ) |
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.
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.
bool CLIPS::Environment::watch | ( | const std::string & | item | ) |
|
inlineprotected |
Referenced by add_function().
|
staticprotected |
|
protected |
Map from function name to restrictions.
This is required for some versions of GCC (at least on 4.4.3), where the argstring in add_function() would point to the very same memory on consecutive calls for the same overloaded version, which would lead to the signature of a function in CLIPS being wrong if functions with the same number of arguments but different types would be added.
Referenced by get_function_restriction().
|
protected |
Mutex that protects against multiple executions.
|
protected |
Mutex that protects access to the run queue.
|
protected |
Mutex that protects against multiple signal emits.
|
protected |
Mutex that locks when a threaded run is executing.
|
protected |
A priority queue of jobs to run.
|
protected |
A pointer to the currently running thread.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Signal emitted when a job is run.
|
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().