Soar Kernel  9.3.2 08-06-12
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Data Structures | Macros | Typedefs | Enumerations | Functions
callback.h File Reference
#include <string>

Go to the source code of this file.

Data Structures

struct  callback_struct

Macros

#define CALLBACK_H
#define NUMBER_OF_MONITORABLE_CALLBACKS   (NUMBER_OF_CALLBACKS - 2)

Typedefs

typedef struct agent_struct agent
typedef char Bool
typedef struct cons_struct cons
typedef cons list
typedef void * soar_call_data
typedef struct callback_struct soar_callback
typedef void * soar_callback_data
typedef int soar_callback_event_id
typedef void(* soar_callback_fn )(agent *, soar_callback_event_id, soar_callback_data, soar_call_data)
typedef void(* soar_callback_free_fn )(soar_callback_data)
typedef const char * soar_callback_id

Enumerations

enum  SOAR_CALLBACK_TYPE

Functions

void soar_add_callback (agent *thisAgent, SOAR_CALLBACK_TYPE, soar_callback_fn, soar_callback_event_id, soar_callback_data, soar_callback_free_fn, soar_callback_id)
void soar_callback_data_free_string (soar_callback_data)
const char * soar_callback_enum_to_name (SOAR_CALLBACK_TYPE, Bool)
SOAR_CALLBACK_TYPE soar_callback_name_to_enum (char *, Bool)
void soar_destroy_callback (soar_callback *)
Bool soar_exists_callback (agent *, SOAR_CALLBACK_TYPE)
soar_callbacksoar_exists_callback_id (agent *the_agent, SOAR_CALLBACK_TYPE callback_type, soar_callback_id id)
void soar_init_callbacks (agent *)
void soar_invoke_callbacks (agent *thisAgent, SOAR_CALLBACK_TYPE, soar_call_data)
void soar_invoke_first_callback (agent *thisAgent, SOAR_CALLBACK_TYPE, soar_call_data)
void soar_list_all_callbacks (agent *, Bool)
void soar_list_all_callbacks_for_event (agent *thisAgent, SOAR_CALLBACK_TYPE)
void soar_pop_callback (agent *the_agent, SOAR_CALLBACK_TYPE callback_type)
void soar_print_detailed_callback_stats ()
void soar_push_callback (agent *the_agent, SOAR_CALLBACK_TYPE callback_type, soar_callback_fn fn, soar_callback_data data, soar_callback_free_fn free_fn)
void soar_remove_all_callbacks_for_event (agent *thisAgent, SOAR_CALLBACK_TYPE)
void soar_remove_all_monitorable_callbacks (agent *thisAgent)
void soar_remove_callback (agent *thisAgent, SOAR_CALLBACK_TYPE, soar_callback_id)
void soar_test_all_monitorable_callbacks (agent *)

Macro Definition Documentation

#define CALLBACK_H

Definition at line 327 of file callback.h.

#define NUMBER_OF_MONITORABLE_CALLBACKS   (NUMBER_OF_CALLBACKS - 2)

Typedef Documentation

typedef struct agent_struct agent

Definition at line 336 of file callback.h.

typedef char Bool

Definition at line 330 of file callback.h.

typedef struct cons_struct cons

Definition at line 343 of file callback.h.

typedef cons list

Definition at line 344 of file callback.h.

typedef void* soar_call_data

Definition at line 333 of file callback.h.

typedef void* soar_callback_data

Definition at line 332 of file callback.h.

Definition at line 334 of file callback.h.

typedef void(* soar_callback_fn)(agent *, soar_callback_event_id, soar_callback_data, soar_call_data)

Definition at line 338 of file callback.h.

typedef void(* soar_callback_free_fn)(soar_callback_data)

Definition at line 342 of file callback.h.

typedef const char* soar_callback_id

Definition at line 331 of file callback.h.

Enumeration Type Documentation

Enumerator:
NO_CALLBACK 
AFTER_INIT_AGENT_CALLBACK 
BEFORE_INIT_SOAR_CALLBACK 
AFTER_INIT_SOAR_CALLBACK 
AFTER_HALT_SOAR_CALLBACK 
BEFORE_ELABORATION_CALLBACK 
AFTER_ELABORATION_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 
BEFORE_PROPOSE_PHASE_CALLBACK 
AFTER_PROPOSE_PHASE_CALLBACK 
BEFORE_APPLY_PHASE_CALLBACK 
AFTER_APPLY_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 
AFTER_INTERRUPT_CALLBACK 
AFTER_HALTED_CALLBACK 
BEFORE_RUN_STARTS_CALLBACK 
AFTER_RUN_ENDS_CALLBACK 
BEFORE_RUNNING_CALLBACK 
AFTER_RUNNING_CALLBACK 
FIRING_CALLBACK 
RETRACTION_CALLBACK 
SYSTEM_PARAMETER_CHANGED_CALLBACK 
MAX_MEMORY_USAGE_CALLBACK 
XML_GENERATION_CALLBACK 
PRINT_CALLBACK 
LOG_CALLBACK 
INPUT_WME_GARBAGE_COLLECTED_CALLBACK 
NUMBER_OF_CALLBACKS 

Definition at line 48 of file callback.h.

Function Documentation

Definition at line 115 of file callback.cpp.

References callback_struct::data, callback_struct::eventid, callback_struct::free_function, callback_struct::function, callback_struct::id, push(), and agent_struct::soar_callbacks.

Referenced by add_input_function(), add_output_function(), and soar_test_all_monitorable_callbacks().

{
cb = new soar_callback;
cb->function = fn;
cb->data = data;
cb->eventid = eventid ;
cb->free_function = free_fn;
cb->id = id;
push(thisAgent, cb, thisAgent->soar_callbacks[callback_type]);
//std::cout << soar_callback_enum_to_name(callback_type, false)
// << " (" << callback_count(thisAgent, callback_type) << ")";
//if (callback_timers.find(callback_type) == callback_timers.end())
//{
// callback_timers[callback_type] = soar_timer_accumulator();
// std::cout << " created timer";
//}
//std::cout << std::endl;
}
void soar_callback_data_free_string ( soar_callback_data  )

Definition at line 155 of file callback.cpp.

{
free(data);
}
const char* soar_callback_enum_to_name ( SOAR_CALLBACK_TYPE  ,
Bool   
)

Definition at line 160 of file callback.cpp.

References NUMBER_OF_CALLBACKS, NUMBER_OF_MONITORABLE_CALLBACKS, and soar_callback_names.

Referenced by soar_list_all_callbacks(), and soar_test_all_monitorable_callbacks().

{
int limit;
if (monitorable_only)
{
}
else
{
}
if ((0 < i) && (i < limit))
{
}
return NULL;
}
SOAR_CALLBACK_TYPE soar_callback_name_to_enum ( char *  ,
Bool   
)

Definition at line 181 of file callback.cpp.

References NO_CALLBACK, NUMBER_OF_CALLBACKS, NUMBER_OF_MONITORABLE_CALLBACKS, and soar_callback_names.

{
int limit;
int i; // i was originally of type SOAR_CALLBACK_TYPE, changed for c++ compatibility (5/1/02)
if (monitorable_only)
{
}
else
{
}
for(i = 1; i < limit; i++)
{
if (!strcmp(name, soar_callback_names[i]))
{
return static_cast<SOAR_CALLBACK_TYPE>(i);
}
}
return NO_CALLBACK;
}
void soar_destroy_callback ( soar_callback )

Definition at line 245 of file callback.cpp.

References callback_struct::data, and callback_struct::free_function.

Referenced by soar_pop_callback(), soar_remove_all_callbacks_for_event(), and soar_remove_callback().

{
if (cb->free_function)
{
cb->free_function(cb->data);
}
delete cb;
}
Bool soar_exists_callback ( agent ,
SOAR_CALLBACK_TYPE   
)

Definition at line 207 of file callback.cpp.

References FALSE, agent_struct::soar_callbacks, and TRUE.

{
list * cb_cons;
cb_cons = the_agent->soar_callbacks[callback_type];
if (cb_cons == NULL)
{
return FALSE;
}
return TRUE;
}
soar_callback* soar_exists_callback_id ( agent the_agent,
SOAR_CALLBACK_TYPE  callback_type,
soar_callback_id  id 
)

Definition at line 222 of file callback.cpp.

References cons_struct::first, callback_struct::id, NIL, cons_struct::rest, and agent_struct::soar_callbacks.

Referenced by add_output_function(), remove_output_function(), and update_for_top_state_wme_addition().

{
cons * c;
for (c = the_agent->soar_callbacks[callback_type];
c != NIL;
c = c->rest)
{
cb = static_cast< soar_callback* >(c->first);
if (cb->id == id)
{
return cb;
}
}
return NULL;
}
void soar_init_callbacks ( agent )

Definition at line 91 of file callback.cpp.

References NIL, NUMBER_OF_CALLBACKS, and agent_struct::soar_callbacks.

Referenced by create_soar_agent().

{
int ct; // ct was originally of type SOAR_CALLBACK_TYPE, changed for c++ compatibility (5/1/02)
for (ct = 1; ct < NUMBER_OF_CALLBACKS; ct++)
{
the_agent->soar_callbacks[ct] = NIL;
}
}
void soar_invoke_callbacks ( agent thisAgent,
SOAR_CALLBACK_TYPE  ,
soar_call_data   
)

Definition at line 256 of file callback.cpp.

References AFTER_APPLY_PHASE_CALLBACK, AFTER_DECISION_CYCLE_CALLBACK, AFTER_DECISION_PHASE_CALLBACK, AFTER_ELABORATION_CALLBACK, AFTER_INPUT_PHASE_CALLBACK, AFTER_OUTPUT_PHASE_CALLBACK, AFTER_PREFERENCE_PHASE_CALLBACK, AFTER_PROPOSE_PHASE_CALLBACK, AFTER_WM_PHASE_CALLBACK, BEFORE_APPLY_PHASE_CALLBACK, BEFORE_DECISION_CYCLE_CALLBACK, BEFORE_DECISION_PHASE_CALLBACK, BEFORE_ELABORATION_CALLBACK, BEFORE_INPUT_PHASE_CALLBACK, BEFORE_OUTPUT_PHASE_CALLBACK, BEFORE_PREFERENCE_PHASE_CALLBACK, BEFORE_PROPOSE_PHASE_CALLBACK, BEFORE_WM_PHASE_CALLBACK, agent_struct::callback_timers, agent_struct::current_phase, callback_struct::data, callback_struct::eventid, cons_struct::first, callback_struct::function, INPUT_PHASE_CALLBACK, NIL, cons_struct::rest, agent_struct::soar_callbacks, agent_struct::timers_decision_cycle_phase, agent_struct::timers_input_function_cpu_time, agent_struct::timers_kernel, agent_struct::timers_monitors_cpu_time, agent_struct::timers_phase, and agent_struct::timers_total_kernel_time.

Referenced by add_production_to_rete(), create_instantiation(), create_new_attribute_impasse_for_slot(), create_new_context(), do_buffered_wm_changes(), do_input_cycle(), do_one_top_level_phase(), do_preference_phase(), excise_production_from_rete(), halt_rhs_function_code(), print_string(), reinitialize_soar(), remove_existing_attribute_impasse_for_slot(), remove_existing_context_and_descendents(), remove_wme_list_from_wm(), reteload_node_and_children(), retract_instantiation(), and set_sysparam().

{
cons * c; /* we need this if we loop over multiple callback functions */
/* if no callback is registered, just return */
if (!thisAgent->soar_callbacks[callback_type]) return;
/* REW: begin 28.07.96 */
/* We want to stop the Soar kernel timers whenever a callback is initiated and
keep track of how much time the callbacks take cumulatively. This
switch doesn't include every pre-defined callback -- however, it should
provide a good "ballpark" estimate because it is focused on all those
that occur doing do_one_top_level_phase in init_soar.c.
Note that this case will only be compiled if NO_TIMING_STUFF is not
defined. So, if you are worried about the performance costs of this case,
you can always get rid of it by not including the timing code. */
#ifndef NO_TIMING_STUFF
switch (callback_type) {
/* This case is necssary to make sure we are in one of the decision cycle
monitors when the routine is invoked. If so, then we want to turn off
the current timers and turn on the appropriate monitor timers. The
'appropriate' timer is determined by the current phase. */
/* for above three: thisAgent->current_phase = INPUT_PHASE */
/* for above two: thisAgent->current_phase = OUTPUT_PHASE */
/* for above two: thisAgent->current_phase = PREFERENCE_PHASE soar7 only */
/* for above two: thisAgent->current_phase = WM_PHASE soar7 only */
/* for above two: thisAgent->current_phase = DECISION_PHASE */
/* for above two: thisAgent->current_phase = PROPOSE_PHASE soar8 only */
/* for above two: thisAgent->current_phase = APPLY_PHASE soar8 only */
/* for soar7: thisAgent->current_phase = DECISION_PHASE; for soar8 it's OUTPUT_PHASE */
thisAgent->timers_phase.stop();
thisAgent->timers_kernel.stop();
thisAgent->timers_total_kernel_time.update(thisAgent->timers_kernel);
thisAgent->timers_decision_cycle_phase[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->timers_phase.start();
break;
/* Stop the kernel and phase timers for the input function.
* the output function is done in do_output_phase */
thisAgent->timers_phase.stop();
thisAgent->timers_kernel.stop();
thisAgent->timers_total_kernel_time.update(thisAgent->timers_kernel);
thisAgent->timers_decision_cycle_phase[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->timers_kernel.start();
break;
default: break;
}
#endif
/* REW: end 28.07.96 */
for (c = thisAgent->soar_callbacks[callback_type];
c != NIL;
c = c->rest)
{
cb = static_cast< soar_callback* >(c->first);
cb->function(thisAgent, cb->eventid, cb->data, call_data);
}
/* REW: begin 28.07.96 */
#ifndef NO_TIMING_STUFF
switch (callback_type) {
/* for soar7: thisAgent->current_phase = DECISION_PHASE; for soar8 it's OUTPUT_PHASE */
thisAgent->timers_phase.stop();
thisAgent->timers_monitors_cpu_time[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->callback_timers[callback_type].update(thisAgent->timers_phase);
thisAgent->timers_kernel.start();
thisAgent->timers_phase.start();
break;
/* Stop input_function_cpu_time timer. Restart kernel and phase timers */
thisAgent->timers_kernel.stop();
thisAgent->timers_input_function_cpu_time.update(thisAgent->timers_kernel);
thisAgent->callback_timers[callback_type].update(thisAgent->timers_kernel);
thisAgent->timers_kernel.start();
thisAgent->timers_phase.start();
break;
default: break;
}
#endif
/* REW: end 28.07.96 */
}
void soar_invoke_first_callback ( agent thisAgent,
SOAR_CALLBACK_TYPE  ,
soar_call_data   
)

Definition at line 386 of file callback.cpp.

References AFTER_APPLY_PHASE_CALLBACK, AFTER_DECISION_CYCLE_CALLBACK, AFTER_DECISION_PHASE_CALLBACK, AFTER_INPUT_PHASE_CALLBACK, AFTER_OUTPUT_PHASE_CALLBACK, AFTER_PREFERENCE_PHASE_CALLBACK, AFTER_PROPOSE_PHASE_CALLBACK, AFTER_WM_PHASE_CALLBACK, BEFORE_APPLY_PHASE_CALLBACK, BEFORE_DECISION_CYCLE_CALLBACK, BEFORE_DECISION_PHASE_CALLBACK, BEFORE_INPUT_PHASE_CALLBACK, BEFORE_OUTPUT_PHASE_CALLBACK, BEFORE_PREFERENCE_PHASE_CALLBACK, BEFORE_PROPOSE_PHASE_CALLBACK, BEFORE_WM_PHASE_CALLBACK, agent_struct::callback_timers, agent_struct::current_phase, callback_struct::data, callback_struct::eventid, cons_struct::first, callback_struct::function, INPUT_PHASE_CALLBACK, agent_struct::soar_callbacks, agent_struct::timers_decision_cycle_phase, agent_struct::timers_input_function_cpu_time, agent_struct::timers_kernel, agent_struct::timers_monitors_cpu_time, agent_struct::timers_phase, and agent_struct::timers_total_kernel_time.

{
list * head;
/* if no callback is registered, just return */
head = thisAgent->soar_callbacks[callback_type];
if (head == NULL) return;
/* REW: begin 28.07.96 */
#ifndef NO_TIMING_STUFF
switch (callback_type) {
/* for these three: thisAgent->current_phase = INPUT_PHASE */
/* for these two: thisAgent->current_phase = OUTPUT_PHASE */
/* for these two: thisAgent->current_phase = PREFERENCE_PHASE */
/* for these two: thisAgent->current_phase = WM_PHASE */
/* for above two: thisAgent->current_phase = DECISION_PHASE */
/* for above two: thisAgent->current_phase = PROPOSE_PHASE soar8 only */
/* for above two: thisAgent->current_phase = APPLY_PHASE soar8 only */
/* for soar7: thisAgent->current_phase = DECISION_PHASE; for soar8 it's OUTPUT_PHASE */
thisAgent->timers_phase.stop();
thisAgent->timers_kernel.stop();
thisAgent->timers_total_kernel_time.update(thisAgent->timers_kernel);
thisAgent->timers_decision_cycle_phase[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->timers_phase.start();
break;
/* Stop the kernel and phase timers for the input function.
* the output function is done in do_output_phase */
thisAgent->timers_phase.stop();
thisAgent->timers_kernel.stop();
thisAgent->timers_total_kernel_time.update(thisAgent->timers_kernel);
thisAgent->timers_decision_cycle_phase[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->timers_kernel.start();
break;
default: break;
}
#endif
/* REW: end 28.07.96 */
cb = static_cast< soar_callback* >(head->first);
cb->function(thisAgent, cb->eventid, cb->data, call_data);
/* REW: begin 28.07.96 */
#ifndef NO_TIMING_STUFF
switch (callback_type) {
thisAgent->timers_phase.stop();
thisAgent->timers_monitors_cpu_time[thisAgent->current_phase].update(thisAgent->timers_phase);
thisAgent->callback_timers[callback_type].update(thisAgent->timers_phase);
thisAgent->timers_kernel.start();
thisAgent->timers_phase.start();
break;
/* Stop input_function_cpu_time timer. Restart kernel and phase timers */
thisAgent->timers_kernel.stop();
thisAgent->timers_input_function_cpu_time.update(thisAgent->timers_kernel);
thisAgent->callback_timers[callback_type].update(thisAgent->timers_kernel);
thisAgent->timers_kernel.start();
thisAgent->timers_phase.start();
break;
default: break;
}
#endif
/* REW: end 28.07.96 */
}
void soar_list_all_callbacks ( agent ,
Bool   
)

Definition at line 494 of file callback.cpp.

References FALSE, NUMBER_OF_CALLBACKS, NUMBER_OF_MONITORABLE_CALLBACKS, print(), soar_callback_enum_to_name(), and soar_list_all_callbacks_for_event().

{
int limit;
int ct; // ct was originally of type SOAR_CALLBACK_TYPE, changed for c++ compatibility (5/1/02)
if (monitorable_only)
{
}
else
{
}
for (ct = 1; ct < limit; ct++)
{
print(thisAgent, "%s: ", soar_callback_enum_to_name(static_cast<SOAR_CALLBACK_TYPE>(ct), FALSE));
soar_list_all_callbacks_for_event (thisAgent, static_cast<SOAR_CALLBACK_TYPE>(ct));
print(thisAgent, "\n");
}
}
void soar_list_all_callbacks_for_event ( agent thisAgent,
SOAR_CALLBACK_TYPE   
)

Definition at line 517 of file callback.cpp.

References cons_struct::first, callback_struct::id, NIL, print(), cons_struct::rest, and agent_struct::soar_callbacks.

Referenced by soar_list_all_callbacks().

{
cons * c;
for (c = thisAgent->soar_callbacks[ct];
c != NIL;
c = c->rest)
{
cb = static_cast< soar_callback* >(c->first);
print(thisAgent, "%s ", cb->id.c_str());
}
}
void soar_pop_callback ( agent the_agent,
SOAR_CALLBACK_TYPE  callback_type 
)

Definition at line 534 of file callback.cpp.

References cons_struct::first, free_cons(), PRINT_CALLBACK, print_string(), cons_struct::rest, agent_struct::soar_callbacks, and soar_destroy_callback().

{
list * head;
head = thisAgent->soar_callbacks[callback_type];
if (head == NULL)
{
print_string(thisAgent, "Attempt to remove non-existant callback.\n");
return;
}
if ( (callback_type == PRINT_CALLBACK)
&& (head->rest == NULL))
{
print_string(thisAgent, "Attempt to remove last print callback. Ignored.\n");
return;
}
cb = static_cast< soar_callback* >(head->first);
thisAgent->soar_callbacks[callback_type] = head->rest;
free_cons(thisAgent, head);
}
void soar_print_detailed_callback_stats ( )
void soar_push_callback ( agent the_agent,
SOAR_CALLBACK_TYPE  callback_type,
soar_callback_fn  fn,
soar_callback_data  data,
soar_callback_free_fn  free_fn 
)
void soar_remove_all_callbacks_for_event ( agent thisAgent,
SOAR_CALLBACK_TYPE   
)

Definition at line 591 of file callback.cpp.

References cons_struct::first, free_cons(), NIL, cons_struct::rest, agent_struct::soar_callbacks, and soar_destroy_callback().

Referenced by soar_remove_all_monitorable_callbacks().

{
cons * c;
list * next;
next = thisAgent->soar_callbacks[ct];
for (c = next; c != NIL; c = next)
{
cb = static_cast< soar_callback* >(c->first);
next = next->rest;
free_cons(thisAgent, c);
}
thisAgent->soar_callbacks[ct] = NIL;
}
void soar_remove_all_monitorable_callbacks ( agent thisAgent)

Definition at line 581 of file callback.cpp.

References NUMBER_OF_MONITORABLE_CALLBACKS, and soar_remove_all_callbacks_for_event().

Referenced by destroy_soar_agent().

{
int ct; // ct was originally of type SOAR_CALLBACK_TYPE, changed for c++ compatibility (5/1/02)
for (ct = 1; ct < NUMBER_OF_MONITORABLE_CALLBACKS; ct++)
{
soar_remove_all_callbacks_for_event (thisAgent, static_cast<SOAR_CALLBACK_TYPE>(ct));
}
}
void soar_remove_callback ( agent thisAgent,
SOAR_CALLBACK_TYPE  ,
soar_callback_id   
)

Definition at line 613 of file callback.cpp.

References cons_struct::first, free_cons(), callback_struct::id, NIL, cons_struct::rest, agent_struct::soar_callbacks, and soar_destroy_callback().

Referenced by remove_input_function(), and remove_output_function().

{
cons * c;
cons * prev_c = NULL; /* Initialized to placate gcc -Wall */
list * head;
head = thisAgent->soar_callbacks[callback_type];
for (c = head; c != NIL; c = c->rest)
{
cb = static_cast< soar_callback* >(c->first);
if (cb->id == id)
{
if (c != head)
{
prev_c->rest = c->rest;
free_cons(thisAgent, c);
return;
}
else
{
thisAgent->soar_callbacks[callback_type] = head->rest;
free_cons(thisAgent, c);
return;
}
}
prev_c = c;
}
}
void soar_test_all_monitorable_callbacks ( agent )

Definition at line 658 of file callback.cpp.

References NUMBER_OF_MONITORABLE_CALLBACKS, soar_add_callback(), soar_callback_enum_to_name(), soar_callback_test_callback(), and TRUE.

{
int i; // i was originally of type SOAR_CALLBACK_TYPE, changed for c++ compatibility (5/1/02)
static const char * test_callback_name = "test";
for(i = 1; i < NUMBER_OF_MONITORABLE_CALLBACKS; i++)
{
soar_add_callback(thisAgent, static_cast<SOAR_CALLBACK_TYPE>(i),
reinterpret_cast<soar_callback_fn>(soar_callback_test_callback), i,
static_cast<void*>(const_cast<char*>(soar_callback_enum_to_name(static_cast<SOAR_CALLBACK_TYPE>(i), TRUE))),
NULL, test_callback_name);
}
}