| 113 | |
| 114 | #include <iostream> |
| 115 | void soar_add_callback(agent* thisAgent, |
| 116 | SOAR_CALLBACK_TYPE callback_type, |
| 117 | soar_callback_fn fn, |
| 118 | soar_callback_event_id eventid, |
| 119 | soar_callback_data data, |
| 120 | soar_callback_free_fn free_fn, |
| 121 | soar_callback_id id) |
| 122 | { |
| 123 | |
| 124 | soar_callback* cb; |
| 125 | |
| 126 | cb = new soar_callback; |
| 127 | cb->function = fn; |
| 128 | cb->data = data; |
| 129 | cb->eventid = eventid ; |
| 130 | cb->free_function = free_fn; |
| 131 | cb->id = id; |
| 132 | |
| 133 | push(thisAgent, cb, thisAgent->soar_callbacks[callback_type]); |
| 134 | |
| 135 | //std::cout << soar_callback_enum_to_name(callback_type, false) |
| 136 | // << " (" << callback_count(thisAgent, callback_type) << ")"; |
| 137 | //if (callback_timers.find(callback_type) == callback_timers.end()) |
| 138 | //{ |
| 139 | // callback_timers[callback_type] = soar_timer_accumulator(); |
| 140 | // std::cout << " created timer"; |
| 141 | //} |
| 142 | //std::cout << std::endl; |
| 143 | } |
| 144 | |
| 145 | //void soar_print_detailed_callback_stats() |
| 146 | //{ |