Go to the source code of this file.
Compounds | |
struct | callback_struct |
Typedefs | |
typedef void* | soar_callback_agent |
The agent upon which the callback is invoked. More... | |
typedef char* | soar_callback_id |
A callback id is also a string. | |
typedef void* | soar_callback_data |
Data sent to the callback function each time it is invoked. More... | |
typedef void* | soar_call_data |
Data sent to the callback function. More... | |
typedef void (* | soar_callback_fn )(soar_callback_agent, soar_callback_data, soar_call_data) |
Any callback registered with Soar, must be in this format. | |
Enumerations | |
enum | SOAR_CALLBACK_TYPE { NO_CALLBACK, SYSTEM_STARTUP_CALLBACK, SYSTEM_TERMINATION_CALLBACK, BEFORE_INIT_SOAR_CALLBACK, AFTER_INIT_SOAR_CALLBACK, AFTER_HALT_SOAR_CALLBACK, BEFORE_SCHEDULE_CYCLE_CALLBACK, AFTER_SCHEDULE_CYCLE_CALLBACK, BEFORE_DECISION_CYCLE_CALLBACK, AFTER_DECISION_CYCLE_CALLBACK, BEFORE_INPUT_PHASE_CALLBACK, INPUT_PHASE_CALLBACK, AFTER_INPUT_PHASE_CALLBACK, BEFORE_PREFERENCE_PHASE_CALLBACK, AFTER_PREFERENCE_PHASE_CALLBACK, BEFORE_WM_PHASE_CALLBACK, AFTER_WM_PHASE_CALLBACK, BEFORE_OUTPUT_PHASE_CALLBACK, OUTPUT_PHASE_CALLBACK, AFTER_OUTPUT_PHASE_CALLBACK, BEFORE_DECISION_PHASE_CALLBACK, AFTER_DECISION_PHASE_CALLBACK, WM_CHANGES_CALLBACK, CREATE_NEW_CONTEXT_CALLBACK, POP_CONTEXT_STACK_CALLBACK, CREATE_NEW_ATTRIBUTE_IMPASSE_CALLBACK, REMOVE_ATTRIBUTE_IMPASSE_CALLBACK, PRODUCTION_JUST_ADDED_CALLBACK, PRODUCTION_JUST_ABOUT_TO_BE_EXCISED_CALLBACK, FIRING_CALLBACK, RETRACTION_CALLBACK, SYSTEM_PARAMETER_CHANGED_CALLBACK, PRINT_CALLBACK, LOG_CALLBACK, ASK_CALLBACK, WAIT_CALLBACK, NUMBER_OF_CALLBACKS } |
enum | SOAR_GLOBAL_CALLBACK_TYPE { NO_GLOBAL_CALLBACK, GLB_CREATE_AGENT, GLB_AGENT_CREATED, GLB_DESTROY_AGENT, NUMBER_OF_GLOBAL_CALLBACKS } |
Copyright (c) 1995-1999 Carnegie Mellon University, University of Michigan, University of Southern California/Information Sciences Institute. All rights reserved.
The Soar consortium proclaims this software is in the public domain, and is made available AS IS. Carnegie Mellon University, The University of Michigan, and The University of Southern California/Information Sciences Institute make no warranties about the software or its performance, implied or otherwise. All rights reserved.
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.
|
Data sent to the callback function. This content of this data is determined solely by the type of callback and the internals of Soar |
|
The agent upon which the callback is invoked. Directly castable to either agent * or psoar_agent |
|
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. |
|
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.
|
|
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:
|