Go to the source code of this file.
Copyright 1995-2003 Carnegie Mellon University, University of Michigan, University of Southern California/Information Sciences Institute. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE SOAR CONSORTIUM ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE SOAR CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Carnegie Mellon University, the University of Michigan, the University of Southern California/Information Sciences Institute, or the Soar consortium. =======================================================================
Each agent has a separate callback table. The table has one entry per callback type and the entry is a pointer to a list. The list contains installed callbacks, one callback per list cons cell.
Definition in file callback.h.
|
|
Data sent to the callback function. This content of this data is determined solely by the type of callback and the internals of Soar Definition at line 417 of file callback.h. Referenced by abort_with_fatal_error(), add_production_to_rete(), cb_appendToSoarResultResult(), cb_soar_PrintToFile(), cb_soarResult_AppendResult(), create_instantiation(), do_buffered_wm_changes(), do_input_cycle(), do_one_top_level_phase(), excise_production_from_rete(), just_before_exit_soar(), replay_input_wme(), reteload_node_and_children(), retract_instantiation(), run_current_agent(), run_preference_semantics(), set_sysparam(), soar_cCreateAgent(), soar_cDefaultAskCallback(), soar_cDestroyAgentByAddress(), soar_cReInitSoar(), soar_cTestCallback(), soar_default_create_agent_procedure(), soar_invoke_callbacks(), soar_invoke_first_callback(), and soar_invoke_global_callbacks(). |
|
|
|
The agent upon which the callback is invoked. Directly castable to either agent * or psoar_agent Definition at line 397 of file callback.h. Referenced by cb_soar_PrintToFile(), replay_input_wme(), soar_cAddCallback(), soar_cDefaultAskCallback(), soar_cListAllCallbacks(), soar_cListAllCallbacksForEvent(), soar_cPopCallback(), soar_cPushCallback(), soar_cRemoveAllCallbacksForEvent(), soar_cRemoveAllMonitorableCallbacks(), soar_cRemoveCallback(), soar_cTestAllMonitorableCallbacks(), soar_cTestCallback(), soar_default_create_agent_procedure(), soar_exists_callback(), soar_exists_callback_id(), soar_init_callbacks(), soar_invoke_callbacks(), soar_invoke_first_callback(), soar_invoke_global_callbacks(), soar_list_all_callbacks(), soar_list_all_callbacks_for_event(), soar_remove_all_callbacks_for_event(), soar_remove_all_monitorable_callbacks(), and soar_test_all_monitorable_callbacks(). |
|
|
Definition at line 391 of file callback.h. |
|
|
Data sent to the callback function each time it is invoked. This data is available at the time the user registers the callback, and has nothing to do with Soar's internals whatsoever. Definition at line 410 of file callback.h. Referenced by add_input_function(), add_output_function(), cb_appendToSoarResultResult(), cb_soar_PrintToFile(), cb_soarResult_AppendResult(), replay_input_wme(), soar_cAddCallback(), soar_cAddGlobalCallback(), soar_cAddInputFunction(), soar_cAddOutputFunction(), soar_callback_data_free_string(), soar_cDefaultAskCallback(), soar_cPushCallback(), soar_cTestCallback(), and soar_ecOpenLog(). |
|
|
Any callback registered with Soar, must be in this format.
Definition at line 423 of file callback.h. Referenced by add_input_function(), add_output_function(), soar_cAddCallback(), soar_cAddGlobalCallback(), soar_cAddInputFunction(), soar_cAddOutputFunction(), soar_cPushCallback(), soar_cTestAllMonitorableCallbacks(), and soar_ecOpenLog(). |
|
|
Definition at line 425 of file callback.h. Referenced by add_input_function(), add_output_function(), soar_cAddCallback(), soar_cAddGlobalCallback(), soar_cAddInputFunction(), soar_cAddOutputFunction(), soar_cPushCallback(), and soar_ecOpenLog(). |
|
|
A callback id is also a string.
Definition at line 402 of file callback.h. Referenced by soar_cAddCallback(), soar_cAddGlobalCallback(), soar_cRemoveCallback(), soar_cRemoveGlobalCallback(), and soar_exists_callback_id(). |
|
|
Definition at line 117 of file callback.h. |
|
|
Standard (Agent Specific) Callbacks All callback functions installed by the user must use the function soar_add_callback. The type signature of all callback functions is the same and has the following form: my_callback_fn(agent * a, soar_callback_data scd, soar_call_data call_data); where "a" is a pointer to the agent structure for the agent in which the callback was invoked, "scd" is the data structure given in the installation when soar_add_callback was called, and "call_data" is the data relevant to this particular call. To use the "call_data" parameter, it should first be cast to the appropriate type, which is mentioned below. Since only the "call_data" argument varies for all callbacks, only that argument will be mentioned in the following.
Definition at line 59 of file callback.h. Referenced by soar_callback_name_to_enum(), soar_cCallbackNameToEnum(), soar_cListAllCallbacks(), soar_cRemoveAllMonitorableCallbacks(), soar_cTestAllMonitorableCallbacks(), and soar_init_callbacks(). |
|
|
Global (Agent Independent) Callbacks All global callback functions installed by the user must use the function soar_add_global_callback. The type signature of all callback functions is the same as that used for agent-dependent callbacks and has the following form: my_callback_fn(agent * a, soar_callback_data scd, soar_call_data call_data); however, in some situations, the argument "a" may be NULL, whereas this will never be a case in a normal (agent-dependent) callback. All other parameter, mock those in a normal callback function. Below, arguments are specified for each global callback type:
Definition at line 109 of file callback.h. Referenced by soar_init_global_callbacks(). |
|
|
Definition at line 125 of file callback.c. References soar_callback_data. |
|
||||||||||||
|
Definition at line 130 of file callback.c. References NUMBER_OF_CALLBACKS, and soar_callback_names. Referenced by soar_cListAllCallbacks(), and soar_cTestAllMonitorableCallbacks(). |
|
|
Definition at line 183 of file callback.c. References callback_struct::data, callback_struct::free_function, callback_struct::id, and soar_callback. Referenced by soar_cPopCallback(), soar_cRemoveAllCallbacksForEvent(), soar_cRemoveCallback(), and soar_cRemoveGlobalCallback(). |
|
||||||||||||
|
Definition at line 146 of file callback.c. References agent, list, and soar_callback_agent. Referenced by init_lapse_duration(), run_preference_semantics(), soar_cQuit(), soar_ecCloseLog(), and soar_Log(). |
|
||||||||||||||||
|
Definition at line 162 of file callback.c. References agent, cons, cons_struct::first, callback_struct::id, cons_struct::rest, soar_callback, soar_callback_agent, and soar_callback_id. Referenced by soar_cAddOutputFunction(), soar_cRemoveOutputFunction(), and update_for_top_state_wme_addition(). |
|
|
Definition at line 466 of file callback.c. References list, and soar_global_callbacks. Referenced by soar_cCreateAgent(), and soar_cDestroyAgentByAddress(). |
|
|
Definition at line 106 of file callback.c. References agent, list, NUMBER_OF_CALLBACKS, soar_callback_agent, and SOAR_CALLBACK_TYPE. Referenced by soar_default_create_agent_procedure(). |
|
|
Definition at line 116 of file callback.c. References list, NUMBER_OF_GLOBAL_CALLBACKS, SOAR_GLOBAL_CALLBACK_TYPE, and soar_global_callbacks. Referenced by soar_cInitializeSoar(). |
|
||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
|
Definition at line 479 of file callback.c. References cons, callback_struct::data, cons_struct::first, callback_struct::function, cons_struct::rest, soar_call_data, soar_callback, soar_callback_agent, and soar_global_callbacks. Referenced by soar_cCreateAgent(), soar_cDestroyAgentByAddress(), and soar_default_create_agent_procedure(). |
1.3.5