Drake
LeafOutputPort< T > Class Template Referencefinal

Implements an output port whose value is managed by a cache entry in the same LeafSystem as the port. More...

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

Inheritance diagram for LeafOutputPort< T >:
[legend]
Collaboration diagram for LeafOutputPort< T >:
[legend]

Public Types

using AllocCallback = std::function< std::unique_ptr< AbstractValue >()>
 Signature of a function suitable for allocating an object that can hold a value of a particular output port. More...
 
using CalcCallback = std::function< void(const Context< T > &, AbstractValue *)>
 Signature of a function suitable for calculating a value of a particular output port, given a place to put the value. More...
 
using CalcVectorCallback = std::function< void(const Context< T > &, BasicVector< T > *)>
 Signature of a function suitable for calculating a value of a particular vector-valued output port, given a place to put the value. More...
 

Public Member Functions

 ~LeafOutputPort () override=default
 
 LeafOutputPort (const System< T > *system, SystemBase *system_base, OutputPortIndex index, DependencyTicket ticket, PortDataType data_type, int size, const CacheEntry *cache_entry)
 Constructs a cached output port. More...
 
const CacheEntrycache_entry () const
 Returns the cache entry associated with this output port. More...
 
Does not allow copy, move, or assignment
 LeafOutputPort (const LeafOutputPort &)=delete
 
LeafOutputPortoperator= (const LeafOutputPort &)=delete
 
 LeafOutputPort (LeafOutputPort &&)=delete
 
LeafOutputPortoperator= (LeafOutputPort &&)=delete
 
- Public Member Functions inherited from OutputPort< T >
 ~OutputPort () override=default
 
template<typename ValueType >
const ValueType & Eval (const Context< T > &context) const
 Returns a reference to the up-to-date value of this output port contained in the given Context. More...
 
std::unique_ptr< AbstractValueAllocate () const
 Allocates a concrete object suitable for holding the value to be exposed by this output port, and returns that as an AbstractValue. More...
 
void Calc (const Context< T > &context, AbstractValue *value) const
 Unconditionally computes the value of this output port with respect to the given context, into an already-allocated AbstractValue object whose concrete type must be exactly the same as the type returned by this port's allocator. More...
 
const AbstractValueEvalAbstract (const Context< T > &context) const
 Returns a reference to the value of this output port contained in the given Context. More...
 
const System< T > & get_system () const
 Returns a reference to the System that owns this output port. More...
 
 OutputPort (const OutputPort &)=delete
 
OutputPortoperator= (const OutputPort &)=delete
 
 OutputPort (OutputPort &&)=delete
 
OutputPortoperator= (OutputPort &&)=delete
 
- Public Member Functions inherited from OutputPortBase
virtual ~OutputPortBase ()
 
OutputPortIndex get_index () const
 Returns the index of this output port within the owning System. More...
 
DependencyTicket ticket () const
 Returns the DependencyTicket for this output port within the owning System. More...
 
PortDataType get_data_type () const
 Gets the port data type specified at port construction. More...
 
int size () const
 Returns the fixed size expected for a vector-valued output port. More...
 
const SystemBaseget_system_base () const
 Returns a reference to the System that owns this output port. More...
 
 OutputPortBase (const OutputPortBase &)=delete
 
OutputPortBaseoperator= (const OutputPortBase &)=delete
 
 OutputPortBase (OutputPortBase &&)=delete
 
OutputPortBaseoperator= (OutputPortBase &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from OutputPort< T >
 OutputPort (const System< T > *system, SystemBase *system_base, OutputPortIndex index, DependencyTicket ticket, PortDataType data_type, int size)
 Provides derived classes the ability to set the base class members at construction. More...
 
std::string GetPortIdString () const
 This is useful for error messages and produces a human-readable identification of an offending output port. More...
 
- Protected Member Functions inherited from OutputPortBase
 OutputPortBase (SystemBase *owning_system, OutputPortIndex index, DependencyTicket ticket, PortDataType data_type, int size)
 Provides derived classes the ability to set the base class members at construction. More...
 
SystemBaseget_mutable_system_base ()
 

Detailed Description

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

Implements an output port whose value is managed by a cache entry in the same LeafSystem as the port.

This is intended for internal use in implementing the DeclareOutputPort() variants in LeafSystem.

Template Parameters
TThe vector element type, which must be a valid Eigen scalar.

Instantiated templates for the following kinds of T's are provided:

They are already available to link against in the containing library. No other values for T are currently supported.

Member Typedef Documentation

using AllocCallback = std::function<std::unique_ptr<AbstractValue>()>

Signature of a function suitable for allocating an object that can hold a value of a particular output port.

The result is returned as an AbstractValue even if this is a vector-valued port.

using CalcCallback = std::function<void(const Context<T>&, AbstractValue*)>

Signature of a function suitable for calculating a value of a particular output port, given a place to put the value.

using CalcVectorCallback = std::function<void(const Context<T>&, BasicVector<T>*)>

Signature of a function suitable for calculating a value of a particular vector-valued output port, given a place to put the value.

Constructor & Destructor Documentation

LeafOutputPort ( const LeafOutputPort< T > &  )
delete
LeafOutputPort ( LeafOutputPort< T > &&  )
delete
~LeafOutputPort ( )
overridedefault
LeafOutputPort ( const System< T > *  system,
SystemBase system_base,
OutputPortIndex  index,
DependencyTicket  ticket,
PortDataType  data_type,
int  size,
const CacheEntry cache_entry 
)
inline

Constructs a cached output port.

The system parameter must be the same object as the system_base parameter.

Member Function Documentation

const CacheEntry& cache_entry ( ) const
inline

Returns the cache entry associated with this output port.

Here is the call graph for this function:

LeafOutputPort& operator= ( const LeafOutputPort< T > &  )
delete
LeafOutputPort& operator= ( LeafOutputPort< T > &&  )
delete

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