Drake
OutputPortBase Class Referenceabstract

OutputPortBase handles the scalar type-independent aspects of an OutputPort. More...

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

Public Member Functions

 ~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...
 
Does not allow copy, move, or assignment
 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
 

Protected Member Functions

 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...
 
virtual internal::OutputPortPrerequisite DoGetPrerequisite () const =0
 Concrete output ports must implement this to return the prerequisite dependency ticket for this port, which may be in the current System or one of its immediate child subsystems. 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

OutputPortBase handles the scalar type-independent aspects of an OutputPort.

An OutputPort belongs to a System and represents the properties of one of that System's output ports.

Constructor & Destructor Documentation

◆ OutputPortBase() [1/3]

OutputPortBase ( const OutputPortBase )
delete

◆ OutputPortBase() [2/3]

OutputPortBase ( OutputPortBase &&  )
delete

◆ ~OutputPortBase()

~OutputPortBase ( )
overridedefault

◆ OutputPortBase() [3/3]

OutputPortBase ( internal::SystemMessageInterface *  owning_system,
std::string  name,
OutputPortIndex  index,
DependencyTicket  ticket,
PortDataType  data_type,
int  size 
)
protected

Provides derived classes the ability to set the base class members at construction.

Parameters
owning_systemThe System that owns this output port.
nameA name for the port. Must not be empty. Output port names should be unique within a single System.
indexThe index to be assigned to this OutputPort.
ticketThe DependencyTicket to be assigned to this OutputPort.
data_typeWhether the port described is vector or abstract valued.
sizeIf the port described is vector-valued, the number of elements expected, otherwise ignored.

Member Function Documentation

◆ DoGetPrerequisite()

virtual internal::OutputPortPrerequisite DoGetPrerequisite ( ) const
protectedpure virtual

Concrete output ports must implement this to return the prerequisite dependency ticket for this port, which may be in the current System or one of its immediate child subsystems.

◆ get_data_type()

PortDataType get_data_type

Returns the port data type.

◆ get_index()

OutputPortIndex get_index ( ) const

Returns the index of this output port within the owning System.

For a Diagram, this will be the index within the Diagram, not the index within the LeafSystem whose output port was forwarded.

◆ get_name()

const std::string& get_name

Get port name.

◆ GetFullDescription()

std::string GetFullDescription

Returns a verbose human-readable description of port.

This is useful for error messages or debugging.

◆ operator=() [1/2]

OutputPortBase& operator= ( OutputPortBase &&  )
delete

◆ operator=() [2/2]

OutputPortBase& operator= ( const OutputPortBase )
delete

◆ size()

int size

Returns the fixed size expected for a vector-valued port.

Not meaningful for abstract-valued ports.

◆ ticket()

(Advanced.) Returns the DependencyTicket for this port within the owning System.


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