Drake
DiscreteUpdateEvent< T > Class Template Referencefinal

This class represents a discrete update event. More...

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

Public Types

typedef std::function< void(const Context< T > &, const DiscreteUpdateEvent< T > &, DiscreteValues< T > *)> DiscreteUpdateCallback
 Callback function that processes a discrete update event. More...
 
- Public Types inherited from Event< T >
using TriggerType = systems::TriggerType
 

Public Member Functions

void operator= (const DiscreteUpdateEvent &)=delete
 
 DiscreteUpdateEvent (DiscreteUpdateEvent &&)=delete
 
void operator= (DiscreteUpdateEvent &&)=delete
 
bool is_discrete_update () const override
 Returns true if this is a DiscreteUpdateEvent. More...
 
 DiscreteUpdateEvent ()
 Makes a DiscreteUpdateEvent with no trigger type, no event data, and no specified callback function. More...
 
 DiscreteUpdateEvent (const DiscreteUpdateCallback &callback)
 Makes a DiscreteUpdateEvent with no trigger type, no event data, and the specified callback function. More...
 
void handle (const Context< T > &context, DiscreteValues< T > *discrete_state) const
 Calls the optional callback function, if one exists, with context, 'this' and discrete_state. More...
 
- Public Member Functions inherited from Event< T >
 Event ()
 Constructs an Event with no trigger type and no event data. More...
 
void operator= (const Event &)=delete
 
 Event (Event &&)=delete
 
void operator= (Event &&)=delete
 
virtual ~Event ()
 An object passed. More...
 
std::unique_ptr< EventClone () const
 Clones this instance. More...
 
TriggerType get_trigger_type () const
 Returns the trigger type. More...
 
bool has_event_data () const
 Returns true if this event has associated data. More...
 
const EventDataget_event_data () const
 Returns a const pointer to the event data. More...
 
EventDataget_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

- Protected Member Functions inherited from Event< T >
 Event (const Event &other)
 

Detailed Description

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 given const Context and const DiscreteUpdateEvent references, and writes the updates to a mutable, non-null DiscreteValues object.

Member Typedef Documentation

◆ DiscreteUpdateCallback

typedef std::function<void(const Context<T>&, const DiscreteUpdateEvent<T>&, DiscreteValues<T>*)> DiscreteUpdateCallback

Callback function that processes a discrete update event.

Constructor & Destructor Documentation

◆ DiscreteUpdateEvent() [1/3]

◆ DiscreteUpdateEvent() [2/3]

DiscreteUpdateEvent ( )
inline

Makes a DiscreteUpdateEvent with no trigger type, no event data, and no specified callback function.

◆ DiscreteUpdateEvent() [3/3]

DiscreteUpdateEvent ( const DiscreteUpdateCallback callback)
inlineexplicit

Makes a DiscreteUpdateEvent with no trigger type, no event data, and the specified callback function.

Member Function Documentation

◆ handle()

void handle ( const Context< T > &  context,
DiscreteValues< T > *  discrete_state 
) const
inline

Calls the optional callback function, if one exists, with context, 'this' and discrete_state.

◆ is_discrete_update()

bool is_discrete_update ( ) const
inlineoverridevirtual

Returns true if this is a DiscreteUpdateEvent.

Implements Event< T >.

◆ operator=() [1/2]

void operator= ( const DiscreteUpdateEvent< T > &  )
delete

◆ operator=() [2/2]

void operator= ( DiscreteUpdateEvent< T > &&  )
delete

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