MCPcopy Create free account
hub / github.com/comaps/comaps / RunScenario

Method RunScenario

libs/drape_frontend/scenario_manager.cpp:40–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40bool ScenarioManager::RunScenario(ScenarioData && scenarioData, ScenarioCallback const & onStartFn,
41 ScenarioCallback const & onFinishFn)
42{
43 std::lock_guard<std::mutex> lock(m_mutex);
44 if (m_thread != nullptr)
45 {
46 if (m_isFinished)
47 InterruptImpl();
48 else
49 return false; // The only scenario can be executed currently.
50 }
51
52 std::swap(m_scenarioData, scenarioData);
53 m_onStartHandler = onStartFn;
54 m_onFinishHandler = onFinishFn;
55 m_thread = std::make_unique<threads::SimpleThread>(&ScenarioManager::ThreadRoutine, this);
56#ifdef DEBUG
57 m_threadId = m_thread->get_id();
58#endif
59 return true;
60}
61
62bool ScenarioManager::IsRunning()
63{

Callers

nothing calls this directly

Calls 2

swapFunction · 0.50
get_idMethod · 0.45

Tested by

no test coverage detected