MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / request

Method request

common/script/scriptuibridge.cpp:29–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include "scriptuibridge.hpp"
28
29UiResponse ScriptUiBridge::request(UiRequest req)
30{
31 std::unique_lock<std::mutex> lock(mMutex);
32 if (mCancelled) {
33 // Abort in progress: don't park, hand back "cancelled" so the script
34 // reaches its next statement (where picoc's abort hook fails the run).
35 return UiResponse{};
36 }
37 mReq = std::move(req);
38 mTaken = false;
39 mCv.wait(lock, [this] { return mResp.has_value(); });
40 UiResponse out = std::move(*mResp);
41 mReq.reset();
42 mResp.reset();
43 mTaken = false;
44 return out;
45}
46
47void ScriptUiBridge::setStatus(std::string text)
48{

Callers 6

ckpt_gui_messageFunction · 0.45
ckpt_gui_confirmFunction · 0.45
ckpt_gui_pick_oneFunction · 0.45
ckpt_gui_pick_manyFunction · 0.45
ckpt_gui_keyboardFunction · 0.45
ckpt_gui_numpadFunction · 0.45

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected