MCPcopy Create free account
hub / github.com/SoarGroup/Soar / soar_remove_callback

Function soar_remove_callback

Core/SoarKernel/src/callback.cpp:627–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625}
626
627void soar_remove_callback(agent* thisAgent,
628 SOAR_CALLBACK_TYPE callback_type,
629 soar_callback_id id)
630{
631 cons* c;
632 cons* prev_c = NULL; /* Initialized to placate gcc -Wall */
633 list* head;
634
635 head = thisAgent->soar_callbacks[callback_type];
636
637 for (c = head; c != NIL; c = c->rest)
638 {
639 soar_callback* cb;
640
641 cb = static_cast< soar_callback* >(c->first);
642
643 if (cb->id == id)
644 {
645 if (c != head)
646 {
647 prev_c->rest = c->rest;
648 soar_destroy_callback(cb);
649 free_cons(thisAgent, c);
650 return;
651 }
652 else
653 {
654 thisAgent->soar_callbacks[callback_type] = head->rest;
655 soar_destroy_callback(cb);
656 free_cons(thisAgent, c);
657 return;
658 }
659 }
660 prev_c = c;
661 }
662}
663
664void soar_callback_test_callback(agent* /*the_agent*/,
665 soar_callback_data data,

Callers 4

remove_input_functionFunction · 0.85
remove_output_functionFunction · 0.85
~AgentSMLMethod · 0.85
UnregisterWithKernelMethod · 0.85

Calls 2

soar_destroy_callbackFunction · 0.85
free_consFunction · 0.85

Tested by

no test coverage detected