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

Function soar_pop_callback

Core/SoarKernel/src/callback.cpp:548–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void soar_pop_callback(agent* thisAgent,
549 SOAR_CALLBACK_TYPE callback_type)
550{
551 list* head;
552 soar_callback* cb;
553
554 head = thisAgent->soar_callbacks[callback_type];
555
556 if (head == NULL)
557 {
558 print_string(thisAgent, "Attempt to remove non-existant callback.\n");
559 return;
560 }
561
562 if ((callback_type == PRINT_CALLBACK)
563 && (head->rest == NULL))
564 {
565 print_string(thisAgent, "Attempt to remove last print callback. Ignored.\n");
566 return;
567 }
568
569 cb = static_cast< soar_callback* >(head->first);
570
571 thisAgent->soar_callbacks[callback_type] = head->rest;
572 soar_destroy_callback(cb);
573 free_cons(thisAgent, head);
574}
575
576void soar_push_callback(agent* thisAgent,
577 SOAR_CALLBACK_TYPE callback_type,

Callers

nothing calls this directly

Calls 3

print_stringFunction · 0.85
soar_destroy_callbackFunction · 0.85
free_consFunction · 0.85

Tested by

no test coverage detected