Compute Graph Framework SDK Reference  5.16
dw::framework::ManagedPortOutputBase Class Reference

Detailed Description

Base class encapsulates ownership of buffers and interactions with channel in type-agnostic way.

Definition at line 137 of file ManagedPort.hpp.

Inheritance diagram for dw::framework::ManagedPortOutputBase:
Collaboration diagram for dw::framework::ManagedPortOutputBase:

Classes

struct  BoundProperties
 
struct  ConstructProperties
 
struct  Properties
 

Public Member Functions

void acquire ()
 
void bindChannel (ChannelObject *channel) override
 
dw::core::VectorFixed< GenericDatagetAllBuffers ()
 
ChannelMetadatagetMetadata ()
 
const PropertiesgetProperties () const noexcept
 
bool isBound () const noexcept override
 
bool isBufferAvailable () const noexcept
 
void reset () override
 
void send ()
 
void sendAdvTimestamp ()
 
void setCallbackBeforeSend (dw::core::Function< dwStatus()> callback)
 
void setNodeName (const dw::core::StringView &nodeName) noexcept override
 
- Public Member Functions inherited from dw::framework::ManagedPortBase
virtual void bindChannel (ChannelObject *channel)=0
 
void bindLockstepSyncClient (dw::framework::lockstep::ILockstepSyncClient *syncClient)
 
ChannelObjectgetChannel ()
 
const dw::core::StringView & getName () const
 Get the name of the port. More...
 
const dw::core::StringView & getNodeName () const
 Get the name of the node this port belongs to. More...
 
virtual bool isBound () const noexcept=0
 
 ManagedPortBase (const dw::core::StringView &name)
 
 ManagedPortBase (const ManagedPortBase &other)=delete
 
 ManagedPortBase (ManagedPortBase &&other)=delete
 
ManagedPortBaseoperator= (const ManagedPortBase &other)=delete
 
ManagedPortBaseoperator= (ManagedPortBase &&other)=delete
 
virtual void reset ()
 
void setCycleCount (uint32_t cycleCount)
 
virtual void setNodeName (const dw::core::StringView &nodeName) noexcept
 Set the name of the node this port belongs to. More...
 
void setPeriod (uint32_t period)
 
virtual ~ManagedPortBase ()=default
 
- Public Member Functions inherited from dw::framework::PortBase
virtual ~PortBase ()=default
 

Static Public Attributes

static constexpr char LOG_TAG [] {"ManagedPortOutputBase"}
 

Protected Member Functions

GenericData getBufferGeneric ()
 
 ManagedPortOutputBase (const dw::core::StringView &name, ConstructProperties props, GenericDataReference &&ref, std::type_index typeIndex)
 
- Protected Member Functions inherited from dw::framework::ManagedPortBase
 FI_DECLARE_INSTANCE_SET_HANDLE (m_fiHandle)
 

Additional Inherited Members

- Protected Attributes inherited from dw::framework::ManagedPortBase
ChannelObjectm_channel
 
uint32_t m_cycleCount
 
dw::framework::lockstep::ILockstepSyncClientm_lockstepSyncClient
 
dw::core::StringView m_name
 The unique name within set of ports with the same direction. More...
 
dw::core::StringView m_nodeName
 The name of the node this port belongs to. More...
 
uint32_t m_period
 

Class Documentation

◆ dw::framework::ManagedPortOutputBase::BoundProperties

struct dw::framework::ManagedPortOutputBase::BoundProperties
Class Members
bool syncEnabled

Whether this port is a sync port and will stamp the current cycle on all sync packets it produces.

◆ dw::framework::ManagedPortOutputBase::ConstructProperties

struct dw::framework::ManagedPortOutputBase::ConstructProperties

◆ dw::framework::ManagedPortOutputBase::Properties

struct dw::framework::ManagedPortOutputBase::Properties
Collaboration diagram for dw::framework::ManagedPortOutputBase::Properties:
Class Members
BoundProperties boundProperties
ConstructProperties constructProperties

Constructor & Destructor Documentation

◆ ManagedPortOutputBase()

dw::framework::ManagedPortOutputBase::ManagedPortOutputBase ( const dw::core::StringView &  name,
ConstructProperties  props,
GenericDataReference &&  ref,
std::type_index  typeIndex 
)
explicitprotected

Member Function Documentation

◆ acquire()

void dw::framework::ManagedPortOutputBase::acquire ( )

Acquire a buffer from the channel.

Note
only a single buffer may be acquired from channel at any given time. if the port is already holding a buffer this call is a no-op.
client should check after with isBufferAvailable() to know if buffer was actually acquired.
Exceptions
ifchannel returns unexpected error.

◆ bindChannel()

void dw::framework::ManagedPortOutputBase::bindChannel ( ChannelObject channel)
overridevirtual

◆ getAllBuffers()

dw::core::VectorFixed< GenericData > dw::framework::ManagedPortOutputBase::getAllBuffers ( )
Returns
vector of all GenericData allocated in the channel memory pool.

◆ getBufferGeneric()

GenericData dw::framework::ManagedPortOutputBase::getBufferGeneric ( )
protected

◆ getMetadata()

ChannelMetadata & dw::framework::ManagedPortOutputBase::getMetadata ( )

Get the metadata of the acquired buffer.

Returns
header of the acquired buffer

◆ getProperties()

const Properties & dw::framework::ManagedPortOutputBase::getProperties ( ) const
noexcept

◆ isBound()

bool dw::framework::ManagedPortOutputBase::isBound ( ) const
overridevirtualnoexcept

◆ isBufferAvailable()

bool dw::framework::ManagedPortOutputBase::isBufferAvailable ( ) const
noexcept
Returns
true if the Port is holding a buffer acquired from the channel.

◆ reset()

void dw::framework::ManagedPortOutputBase::reset ( )
overridevirtual

Resets the packet sequence counter

Note
does not drop the bound channel.

Reimplemented from dw::framework::ManagedPortBase.

◆ send()

void dw::framework::ManagedPortOutputBase::send ( )

Send the buffer to downstream clients over the channel.

Note
if the Port has no acquired buffer this call is a no-op.
after this call the sent buffer will no longer be available. any pointers deduced from the previously held buffer should not be used.
Exceptions
ifchannel returns unexpected errors.

◆ sendAdvTimestamp()

void dw::framework::ManagedPortOutputBase::sendAdvTimestamp ( )

Send an advance packet if a lockstep sync client is bound.

◆ setCallbackBeforeSend()

void dw::framework::ManagedPortOutputBase::setCallbackBeforeSend ( dw::core::Function< dwStatus()>  callback)

Set callback function to be invoked before sending the data.

◆ setNodeName()

void dw::framework::ManagedPortOutputBase::setNodeName ( const dw::core::StringView &  nodeName)
overridevirtualnoexcept

Reimplemented from dw::framework::ManagedPortBase.

Member Data Documentation

◆ LOG_TAG

constexpr char dw::framework::ManagedPortOutputBase::LOG_TAG[] {"ManagedPortOutputBase"}
staticconstexpr

Definition at line 142 of file ManagedPort.hpp.


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