StatusPublisherInterface.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
6
8
10
12{
13
14 /**
15 * @brief Publishes the lifecycle of gaze targets.
16 *
17 * The seam keeps the Scheduler itself free of the memory (mirroring navigation's
18 * server::EventPublishingInterface), so its queue logic can be tested without one.
19 *
20 * Targets are addressed by the memory ID of the request they came from -- which pins the
21 * requester, the target name *and* the exact snapshot, so two targets scheduled at the same
22 * time under one name stay distinguishable.
23 */
25 {
26 public:
27 virtual ~StatusPublisherInterface() = default;
28
29 /// Admitted to the scheduler's queue.
30 virtual void requested(const armem::MemoryID& gazeTargetID,
31 const armarx::DateTime& creationTimestamp) = 0;
32
33 /// Submitted to the low-level controller.
34 virtual void scheduled(const armem::MemoryID& gazeTargetID) = 0;
35
36 /// The gaze settled on the target.
37 virtual void reached(const armem::MemoryID& gazeTargetID,
38 const gaze_controller::GazeResidual& residual) = 0;
39
40 /// Lost the active slot but stays in the queue. Not terminal.
41 virtual void preempted(const armem::MemoryID& gazeTargetID, const std::string& reason) = 0;
42
43 /// Left the queue having been reached. Terminal, and a success for whoever asked.
44 virtual void released(const armem::MemoryID& gazeTargetID, const std::string& reason) = 0;
45
46 /// Left the queue without ever being reached. Terminal, and a failure.
47 virtual void aborted(const armem::MemoryID& gazeTargetID, const std::string& reason) = 0;
48
49 /**
50 * @brief Whether this target was reached at any point.
51 *
52 * This is what separates `released` from `aborted` when a target stops being active, so it
53 * is answered from the same accumulated lifecycle that gets published -- not from the
54 * scheduler's queue, which may no longer hold the target at all.
55 */
56 virtual bool wasReached(const armem::MemoryID& gazeTargetID) const = 0;
57 };
58
59} // namespace armarx::view_selection::gaze_scheduler
Represents a point in time.
Definition DateTime.h:25
virtual void aborted(const armem::MemoryID &gazeTargetID, const std::string &reason)=0
Left the queue without ever being reached. Terminal, and a failure.
virtual void reached(const armem::MemoryID &gazeTargetID, const gaze_controller::GazeResidual &residual)=0
The gaze settled on the target.
virtual void released(const armem::MemoryID &gazeTargetID, const std::string &reason)=0
Left the queue having been reached. Terminal, and a success for whoever asked.
virtual void requested(const armem::MemoryID &gazeTargetID, const armarx::DateTime &creationTimestamp)=0
Admitted to the scheduler's queue.
virtual bool wasReached(const armem::MemoryID &gazeTargetID) const =0
Whether this target was reached at any point.
virtual void scheduled(const armem::MemoryID &gazeTargetID)=0
Submitted to the low-level controller.
virtual void preempted(const armem::MemoryID &gazeTargetID, const std::string &reason)=0
Lost the active slot but stays in the queue. Not terminal.
How far the gaze currently is from a target.