MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / Run_

Method Run_

IntelPresentMon/PresentMonService/testing/TestControl.cpp:16–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 worker_{ &TestControlModule::Run_, this }
15 {}
16 void TestControlModule::Run_()
17 {
18 std::string line;
19 // wait for ping before entering main execution mode
20 while (std::getline(std::cin, line)) {
21 if (line == "%ping") {
22 WriteResponse_("ping-ok");
23 break;
24 }
25 else {
26 WriteResponse_("err-expect-ping");
27 }
28 }
29 // command execution loop
30 while (std::getline(std::cin, line)) {
31 if (line == "%quit") {
32 SetEvent(pService_->GetServiceStopHandle());
33 WriteResponse_("quit-ok");
34 break;
35 }
36 else if (line == "%status") {
37 std::ostringstream oss;
38 cereal::JSONOutputArchive{ oss }(pPresentMon_->GetTestingStatus());
39 WriteResponse_(oss.str());
40 }
41 else {
42 WriteResponse_("err-bad-command");
43 }
44 }
45 }
46 void TestControlModule::WriteResponse_(const std::string& payload)
47 {
48 std::cout << std::format("%%{{{}}}%%\n", payload) << std::flush;

Callers

nothing calls this directly

Calls 2

GetServiceStopHandleMethod · 0.45
GetTestingStatusMethod · 0.45

Tested by

no test coverage detected