Drake
LeafOutputPort< T > Class Template Referencefinal

(Advanced.) 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>

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 () final
 
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
 
template<typename ValueType = Eigen::VectorBlock<const VectorX<T>>>
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 System< T > & get_system () const
 Returns a reference to the System that owns this output port. More...
 
const AbstractValueEvalAbstract (const Context< T > &context) const
 (Deprecated.) More...
 
Eigen::VectorBlock< const VectorX< T > > EvalEigenVector (const Context< T > &context) const
 (Deprecated.) More...
 
const std::string & get_name () const
 Get port name. More...
 
std::string GetFullDescription () const
 Returns a verbose human-readable description of port. More...
 
OutputPortIndex get_index () const
 Returns the index of this output port within the owning System. More...
 
PortDataType get_data_type () const
 Returns the port data type. More...
 
int size () const
 Returns the fixed size expected for a vector-valued port. More...
 
DependencyTicket ticket () const
 (Advanced.) Returns the DependencyTicket for this port within the owning System. More...
 
 OutputPort (const OutputPort &)=delete
 
OutputPortoperator= (const OutputPort &)=delete
 
 OutputPort (OutputPort &&)=delete
 
OutputPortoperator= (OutputPort &&)=delete
 
- Public Member Functions inherited from OutputPortBase
 ~OutputPortBase () override
 
OutputPortIndex get_index () const
 Returns the index of this output port within the owning System. More...
 
const std::string & get_name () const
 Get port name. More...
 
std::string GetFullDescription () const
 Returns a verbose human-readable description of port. More...
 
PortDataType get_data_type () const
 Returns the port data type. More...
 
int size () const
 Returns the fixed size expected for a vector-valued port. More...
 
DependencyTicket ticket () const
 (Advanced.) Returns the DependencyTicket for this port within the owning System. More...
 
 OutputPortBase (const OutputPortBase &)=delete
 
OutputPortBaseoperator= (const OutputPortBase &)=delete
 
 OutputPortBase (OutputPortBase &&)=delete
 
OutputPortBaseoperator= (OutputPortBase &&)=delete
 
- Public Member Functions inherited from PortBase
virtual ~PortBase ()
 
const std::string & get_name () const
 Get port name. More...
 
std::string GetFullDescription () const
 Returns a verbose human-readable description of port. More...
 
PortDataType get_data_type () const
 Returns the port data type. More...
 
int size () const
 Returns the fixed size expected for a vector-valued port. More...
 
DependencyTicket ticket () const
 (Advanced.) Returns the DependencyTicket for this port within the owning System. More...
 
 PortBase (const PortBase &)=delete
 
PortBaseoperator= (const PortBase &)=delete
 
 PortBase (PortBase &&)=delete
 
PortBaseoperator= (PortBase &&)=delete
 

Friends

class internal::FrameworkFactory
 

Additional Inherited Members

- Protected Member Functions inherited from OutputPort< T >
 OutputPort (const System< T > *system, SystemBase *system_base, std::string name, OutputPortIndex index, DependencyTicket ticket, PortDataType data_type, int size)
 Provides derived classes the ability to set the base class members at construction. More...
 
- Protected Member Functions inherited from OutputPortBase
 OutputPortBase (internal::SystemMessageInterface *owning_system, std::string name, OutputPortIndex index, DependencyTicket ticket, PortDataType data_type, int size)
 Provides derived classes the ability to set the base class members at construction. More...
 
- Protected Member Functions inherited from PortBase
 PortBase (const char *kind_string, internal::SystemMessageInterface *owning_system, std::string name, int index, DependencyTicket ticket, PortDataType data_type, int size)
 Provides derived classes the ability to set the base class members at construction. More...
 
int get_int_index () const
 Returns the index of this port within the owning System (i.e., an InputPortIndex or OutputPortIndex, but as a bare integer). More...
 
internal::SystemMessageInterface & get_mutable_system_base ()
 Returns get_system_base(), but without the const. More...
 
template<typename ValueType >
const ValueType & PortEvalCast (const AbstractValue &abstract) const
 Pull a value of a given type from an abstract value or issue a nice message if the type is not correct. More...
 
template<typename ValueType , typename T >
const ValueType & PortEvalCast (const BasicVector< T > &basic) const
 Downcast a basic vector to a more specific subclass (e.g., as generated by //tools/vector_gen) or issue a nice message if the type is not correct. More...
 
template<typename ValueType >
const ValueType & ThrowBadCast (const AbstractValue &abstract) const
 Reports that the user provided a bad ValueType argument to Eval. More...
 
template<typename ValueType , typename T >
const ValueType & ThrowBadCast (const BasicVector< T > &basic) const
 Reports that the user provided a bad ValueType argument to Eval. More...
 
void ThrowBadCast (const std::string &value_typename, const std::string &eval_typename) const
 Reports that the user provided a bad ValueType argument to Eval. More...
 

Detailed Description

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

(Advanced.) 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

◆ AllocCallback

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.

◆ CalcCallback

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.

◆ CalcVectorCallback

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() [1/2]

LeafOutputPort ( const LeafOutputPort< T > &  )
delete

◆ LeafOutputPort() [2/2]

LeafOutputPort ( LeafOutputPort< T > &&  )
delete

◆ ~LeafOutputPort()

~LeafOutputPort ( )
finaldefault

Member Function Documentation

◆ cache_entry()

const CacheEntry& cache_entry ( ) const

Returns the cache entry associated with this output port.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Friends And Related Function Documentation

◆ internal::FrameworkFactory

friend class internal::FrameworkFactory
friend

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