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

Method DoInitSoar

Core/CLI/src/cli_initsoar.cpp:21–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace cli;
20
21bool CommandLineInterface::DoInitSoar()
22{
23 // Save the current result
24 std::string oldResult = m_Result.str();
25
26 SetTrapPrintCallbacks(false);
27
28 bool ok = m_pAgentSML->Reinitialize() ;
29
30 // S1 gets created during Reinitialize, clear its output from the trace buffers
31 xml_invoke_callback(m_pAgentSML->GetSoarAgent());
32 m_pAgentSML->FlushPrintOutput();
33
34 SetTrapPrintCallbacks(true);
35
36 // restore the old result, ignoring output from init-soar
37 m_Result.str(oldResult);
38
39 if (!ok)
40 {
41 return SetError("Agent failed to reinitialize");
42 }
43
44 if (m_RawOutput)
45 {
46 m_Result << "Agent reinitialized.\n";
47 }
48
49 return ok;
50}
51

Callers 2

DoExciseMethod · 0.95
ParseMethod · 0.45

Calls 3

xml_invoke_callbackFunction · 0.85
SetErrorFunction · 0.85
ReinitializeMethod · 0.80

Tested by

no test coverage detected