maliput
|
Holds the return status from execution of an event handler function, or the effective status after a series of handler executions due to dispatching of simultaneous events.
Drake API users will typically use only the four factory methods below to return status, and optionally a human-readable message, from their event handlers.
#include <src/maliput/drake/systems/framework/event_status.h>
Public Types | |
enum | Severity { kDidNothing = 0, kSucceeded = 1, kReachedTermination = 2, kFailed = 3 } |
The numerical values are ordered, with did_nothing < success < terminate < fatal. More... | |
Public Member Functions | |
Severity | severity () const |
Returns the severity of the current status. More... | |
const SystemBase * | system () const |
Returns the optionally-provided subsystem that generated a status return that can include a message (reached termination or failed). More... | |
const std::string & | message () const |
Returns the optionally-provided human-readable message supplied by the event handler that produced the current status. More... | |
EventStatus & | KeepMoreSevere (EventStatus candidate) |
(Advanced) Replaces the contents of this with the more-severe status if candidate is a more severe status than this one. More... | |
Static Public Member Functions | |
static EventStatus | DidNothing () |
Returns "did nothing" status, with no message. More... | |
static EventStatus | Succeeded () |
Returns "succeeded" status, with no message. More... | |
static EventStatus | ReachedTermination (const SystemBase *system, std::string message) |
Returns "reached termination" status, with a message explaining why. More... | |
static EventStatus | Failed (const SystemBase *system, std::string message) |
Returns "failed" status, with a message explaining why. More... | |
enum Severity |
The numerical values are ordered, with did_nothing < success < terminate < fatal.
|
static |
Returns "did nothing" status, with no message.
|
static |
Returns "failed" status, with a message explaining why.
EventStatus& KeepMoreSevere | ( | EventStatus | candidate | ) |
(Advanced) Replaces the contents of this
with the more-severe status if candidate
is a more severe status than this
one.
Does nothing if candidate
severity is less than or equal to this
severity. This method is for use in event dispatchers for accumulating status returns from a series of event handlers for a set of simultaneous events.
const std::string& message | ( | ) | const |
Returns the optionally-provided human-readable message supplied by the event handler that produced the current status.
Returns an empty string if no message was provided.
|
static |
Returns "reached termination" status, with a message explaining why.
Severity severity | ( | ) | const |
Returns the severity of the current status.
|
static |
Returns "succeeded" status, with no message.
const SystemBase* system | ( | ) | const |
Returns the optionally-provided subsystem that generated a status return that can include a message (reached termination or failed).
Returns nullptr if no subsystem was provided.