18 const std::scoped_lock lock(callbackMutex);
19 subscriptions.requested.push_back(callback);
25 const std::scoped_lock lock(callbackMutex);
26 subscriptions.scheduled.push_back(callback);
32 const std::scoped_lock lock(callbackMutex);
33 subscriptions.reached.push_back(callback);
39 const std::scoped_lock lock(callbackMutex);
40 subscriptions.preempted.push_back(callback);
46 const std::scoped_lock lock(callbackMutex);
47 subscriptions.released.push_back(callback);
53 const std::scoped_lock lock(callbackMutex);
54 subscriptions.aborted.push_back(callback);
60 const std::scoped_lock lock(callbackMutex);
61 subscriptions.any.push_back(callback);
74 const std::vector<Callback> callbacks = [&]()
76 const std::scoped_lock lock(callbackMutex);
78 std::vector<Callback> matching = subscriptions.any;
80 const std::vector<Callback>& specific = [&]() ->
const std::vector<Callback>&
85 return subscriptions.requested;
87 return subscriptions.scheduled;
89 return subscriptions.reached;
91 return subscriptions.preempted;
93 return subscriptions.released;
95 return subscriptions.aborted;
98 return subscriptions.any;
101 matching.insert(matching.end(), specific.begin(), specific.end());
107 for (
const auto& callback : callbacks)
static DateTime Now()
Current time on the virtual clock.
void onReleased(const Callback &callback) override
void onAny(const Callback &callback) override
Called for every update, whatever its status.
void handleStatus(const gaze_targets::GazeTargetStatus &status)
Logs the update and hands it to the matching callbacks.
void onScheduled(const Callback &callback) override
void onAborted(const Callback &callback) override
void onRequested(const Callback &callback) override
void onReached(const Callback &callback) override
void onPreempted(const Callback &callback) override
std::function< void(const gaze_targets::GazeTargetStatus &)> Callback
Business Object (BO) class of GazeTargetStatus: the lifecycle of one gaze target request,...
#define ARMARX_INFO
The normal logging level.
const simox::meta::EnumNames< TargetStatus > TargetStatusNames
@ Scheduled
submitted to the low-level controller
@ Aborted
left the queue without ever being reached, or the target is out of reach
@ Reached
the gaze residual settled below the threshold
@ Released
left the queue having been reached (duration elapsed, or superseded afterwards)
@ Preempted
lost the active slot but stays in the queue and may be scheduled again
@ Requested
admitted to the scheduler's queue, waiting for scheduling