Drake
Drake C++ Documentation
UnrestrictedUpdateEvent< T > Class Template Referencefinal

Detailed Description

template<typename T>
class drake::systems::UnrestrictedUpdateEvent< T >

This class represents an unrestricted 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 State object.

See also
LeafSystem for more convenient interfaces to unrestricted update events via the Declare*UnrestrictedUpdateEvent() methods.

#include <drake/systems/framework/event.h>

Public Member Functions

bool is_discrete_update () const override
 Returns true if this is a DiscreteUpdateEvent. More...
 
 UnrestrictedUpdateEvent ()=default
 Constructs an empty UnrestrictedUpdateEvent. More...
 
 UnrestrictedUpdateEvent (const std::function< EventStatus(const System< T > &, const Context< T > &, const UnrestrictedUpdateEvent< T > &, State< T > *)> &callback)
 Constructs an UnrestrictedUpdateEvent with the given callback function. More...
 
EventStatus handle (const System< T > &system, const Context< T > &context, State< T > *state) const
 Calls the optional callback function, if one exists, with system, context, this and state. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 UnrestrictedUpdateEvent (const UnrestrictedUpdateEvent &)=default
 
UnrestrictedUpdateEventoperator= (const UnrestrictedUpdateEvent &)=default
 
 UnrestrictedUpdateEvent (UnrestrictedUpdateEvent &&)=default
 
UnrestrictedUpdateEventoperator= (UnrestrictedUpdateEvent &&)=default
 
- Public Member Functions inherited from Event< T >
virtual ~Event ()=default
 
std::unique_ptr< EventClone () const
 Clones this instance. More...
 
TriggerType get_trigger_type () const
 Returns the trigger type. More...
 
template<typename EventDataType >
bool has_event_data () const
 Returns true if this event has associated data of the given EventDataType. More...
 
template<typename EventDataType >
const EventDataType * get_event_data () const
 Returns a const pointer to the event data. More...
 
template<typename EventDataType >
EventDataType * get_mutable_event_data ()
 Returns a mutable pointer to the event data. More...
 
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. More...
 
void AddToComposite (CompositeEventCollection< T > *events) const
 Provides an alternate signature for adding an Event that already has the correct trigger type set. More...
 

Additional Inherited Members

- Public Types inherited from Event< T >
using TriggerType = systems::TriggerType
 
- Protected Member Functions inherited from Event< T >
 Event ()=default
 Constructs an empty Event. More...
 
 Event (const Event &)=default
 
Eventoperator= (const Event &)=default
 
 Event (Event &&)=default
 
Eventoperator= (Event &&)=default
 

Constructor & Destructor Documentation

◆ UnrestrictedUpdateEvent() [1/4]

◆ UnrestrictedUpdateEvent() [2/4]

◆ UnrestrictedUpdateEvent() [3/4]

Constructs an empty UnrestrictedUpdateEvent.

◆ UnrestrictedUpdateEvent() [4/4]

UnrestrictedUpdateEvent ( const std::function< EventStatus(const System< T > &, const Context< T > &, const UnrestrictedUpdateEvent< T > &, State< T > *)> &  callback)
explicit

Constructs an UnrestrictedUpdateEvent with the given callback function.

Member Function Documentation

◆ handle()

EventStatus handle ( const System< T > &  system,
const Context< T > &  context,
State< T > *  state 
) const

Calls the optional callback function, if one exists, with system, context, this and state.

◆ is_discrete_update()

bool is_discrete_update ( ) const
overridevirtual

Returns true if this is a DiscreteUpdateEvent.

Implements Event< T >.

◆ operator=() [1/2]

UnrestrictedUpdateEvent& operator= ( const UnrestrictedUpdateEvent< T > &  )
default

◆ operator=() [2/2]

UnrestrictedUpdateEvent& operator= ( UnrestrictedUpdateEvent< T > &&  )
default

The documentation for this class was generated from the following file: