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

Method Run

TestCLI/testcli.h:57–77  ·  view source on GitHub ↗

* Thread entry point. * * This thread spends most of its time blocking on getline. It loops until * stdin goes bad or the thread is stopped before it blocks on getline * again. Most of the time this thread can't be stopped because quit isn't * called until after it is blocking again. */

Source from the content-addressed store, hash-verified

55 * called until after it is blocking again.
56 */
57 virtual void Run()
58 {
59 soar_thread::Lock* lock;
60 while (!this->m_QuitNow && std::cin.good())
61 {
62 std::getline(std::cin, line);
63 if (std::cin.bad())
64 {
65 break;
66 }
67
68 lock = new soar_thread::Lock(&mutex);
69 lines.push(line);
70 write_event.TriggerEvent();
71 if (line == "quit" || line == "exit")
72 {
73 this->m_QuitNow = true;
74 }
75 delete lock;
76 }
77 }
78
79 /**
80 * Get a line of input, block until it is received.

Callers

nothing calls this directly

Calls 4

pushMethod · 0.80
goodMethod · 0.45
badMethod · 0.45
TriggerEventMethod · 0.45

Tested by

no test coverage detected