Class SimpleEventState

Inheritance Relationships

Base Type

Class Documentation

class SimpleEventState : public rmf_task::Event::State

This class is the simplest possible implementation for directly managing the required fields of the Event interface.

This may be useful if you have a Phase implementation that takes care of the logic for tracking your event(s) but you still need an Event object to satisfy the Phase interface’s finish_event() function. Your Phase implementation can create an instance of this class and then manage its fields directly.

Public Functions

virtual uint64_t id() const final

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

SimpleEventState &modify_id(uint64_t new_id)

Change the ID of this event state. Use this with great caution; the ID is generally meant to remain constant. This method is only provided for very niche cases.

virtual Status status() const final

The current Status of this event.

SimpleEventState &update_status(Status new_status)

Update the 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.

SimpleEventState &update_name(std::string new_name)

Update the name of this event.

virtual VersionedString::View detail() const final

A detailed explanation of this event.

SimpleEventState &update_detail(std::string new_detail)

Update the detail of this event.

virtual Log::View log() const final

A view of the log for this event.

Log &update_log()

Update the log.

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

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

SimpleEventState &update_dependencies(std::vector<ConstStatePtr> new_dependencies)

Update the dependencies.

SimpleEventState &add_dependency(ConstStatePtr new_dependency)

Add one dependency to the state.

Public Static Functions

static std::shared_ptr<SimpleEventState> make(uint64_t id, std::string name, std::string detail, Status initial_status, std::vector<ConstStatePtr> dependencies = {}, std::function<rmf_traffic::Time()> clock = nullptr)