Class Event

Nested Relationships

Nested Types

Class Documentation

class Event

Public Types

enum class Status : uint32_t

A simple computer-friendly indicator of the current status of this event. This enum may be used to automatically identify when an event requires special attention, e.g. logging a warning or alerting an operator.

Values:

enumerator Uninitialized

The event status has not been initialized. This is a sentinel value that should not generally be used.

enumerator Blocked

The event is underway but it has been blocked. The blockage may require manual intervention to fix.

enumerator Error

An error has occurred that the Task implementation does not know how to deal with. Manual intervention is needed to get the task back on track.

enumerator Failed

The event cannot ever finish correctly, even with manual intervention. This may mean that the Task cannot be completed if it does not have an automated way to recover from this failure state.

enumerator Standby

The event is on standby. It cannot be started yet, and that is its expected status.

enumerator Underway

The event is underway, and proceeding as expected.

enumerator Delayed

The event is underway but it has been temporarily delayed.

enumerator Skipped

An operator has instructed this event to be skipped.

enumerator Canceled

An operator has instructed this event to be canceled.

enumerator Killed

An operator has instructed this event to be killed.

enumerator Completed

The event has completed.

using ConstStatePtr = std::shared_ptr<const State>
using ConstSnapshotPtr = std::shared_ptr<const Snapshot>
using AssignIDPtr = std::shared_ptr<const AssignID>

Public Static Functions

static Status sequence_status(Status earlier, Status later)

Given the status of two events that are in sequence with each other, return the overall status of the sequence.

class AssignID

A utility class that helps to assign unique IDs to events.

Public Functions

AssignID()

Constructor.

uint64_t assign() const

Get a new unique ID.

Public Static Functions

static AssignIDPtr make()

Make a shared_ptr<AssignID>

class Snapshot : public rmf_task::Event::State

A snapshot of the state of an event. This snapshot can be read while the original event is arbitrarily changed, and there is no risk of a race condition, as long as the snapshot is not being created while the event is changing.

Public Functions

virtual uint64_t id() const final

The ID of this event, which is unique within its phase.

virtual Status status() const final

The current Status of this event.

virtual VersionedString::View name() const final

The “name” of this event. Ideally a short, simple piece of text that helps a human being intuit what this event is expecting at a glance.

virtual VersionedString::View detail() const final

A detailed explanation of this event.

virtual Log::View log() const final

A view of the log for this event.

virtual std::vector<ConstStatePtr> dependencies() const final

Get more granular dependencies of this event, if any exist.

Public Static Functions

static ConstSnapshotPtr make(const State &other)

Make a snapshot of the current state of an Event.

class State

The interface to an active event.

Subclassed by rmf_task::Event::Snapshot, rmf_task::events::SimpleEventState

Public Types

using Status = Event::Status
using ConstStatePtr = Event::ConstStatePtr

Public Functions

virtual uint64_t id() const = 0

The ID of this event, which is unique within its phase.

virtual Status status() const = 0

The current Status of this event.

bool finished() const

A convenience function which returns true if the event’s status is any of Skipped, Canceled, Killed, or Completed.

virtual VersionedString::View name() const = 0

The “name” of this event. Ideally a short, simple piece of text that helps a human being intuit what this event is expecting at a glance.

virtual VersionedString::View detail() const = 0

A detailed explanation of this event.

virtual Log::View log() const = 0

A view of the log for this event.

virtual std::vector<ConstStatePtr> dependencies() const = 0

Get more granular dependencies of this event, if any exist.

virtual ~State() = default