template<typename T>
class drake::systems::DiscreteUpdateEvent< T >
This class represents a discrete update event.
It has an optional callback function to do custom handling of this event, and that can write updates to a mutable, non-null DiscreteValues object.
- See also
- LeafSystem for more convenient interfaces to discrete update events via the Declare*DiscreteUpdateEvent() methods.
|
| bool | is_discrete_update () const override |
| | Returns true if this is a DiscreteUpdateEvent.
|
| | DiscreteUpdateEvent ()=default |
| | Constructs an empty DiscreteUpdateEvent.
|
| | DiscreteUpdateEvent (const std::function< EventStatus(const System< T > &, const Context< T > &, const DiscreteUpdateEvent< T > &, DiscreteValues< T > *)> &callback) |
| | Constructs a DiscreteUpdateEvent with the given callback function.
|
| EventStatus | handle (const System< T > &system, const Context< T > &context, DiscreteValues< T > *discrete_state) const |
| | Calls the optional callback function, if one exists, with system, context, this and discrete_state.
|
| | DiscreteUpdateEvent (const DiscreteUpdateEvent &)=default |
| DiscreteUpdateEvent & | operator= (const DiscreteUpdateEvent &)=default |
| | DiscreteUpdateEvent (DiscreteUpdateEvent &&)=default |
| DiscreteUpdateEvent & | operator= (DiscreteUpdateEvent &&)=default |
| virtual | ~Event () |
| std::unique_ptr< Event > | Clone () const |
| | Clones this instance.
|
| TriggerType | get_trigger_type () const |
| | Returns the trigger type.
|
| template<typename EventDataType> |
| bool | has_event_data () const |
| | Returns true if this event has associated data of the given EventDataType.
|
| template<typename EventDataType> |
| const EventDataType * | get_event_data () const |
| | Returns a const pointer to the event data.
|
| template<typename EventDataType> |
| EventDataType * | get_mutable_event_data () |
| | Returns a mutable pointer to the event data.
|
| void | AddToComposite (TriggerType trigger_type, CompositeEventCollection< T > *events) const |
| | Adds a clone of this event to the event collection events, with the given trigger type.
|
| void | AddToComposite (CompositeEventCollection< T > *events) const |
| | Provides an alternate signature for adding an Event that already has the correct trigger type set.
|