• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • Compute Graph Framework SDK Reference  5.10
    All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
    dw::framework::ManagedPortInputBase Class Reference

    Detailed Description

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

    Definition at line 207 of file ManagedPort.hpp.

    Inheritance diagram for dw::framework::ManagedPortInputBase:
    Collaboration diagram for dw::framework::ManagedPortInputBase:

    Classes

    struct  BoundProperties
     
    struct  ConstructProperties
     
    struct  Properties
     

    Public Types

    using RingBuffer = dw::core::RingBuffer< GenericData >
     

    Public Member Functions

    void bindChannel (ChannelObject *channel) override
     
    const ChannelMetadatagetMetadata ()
     
    const PropertiesgetProperties () const noexcept
     
    bool isBound () const noexcept override
     
    bool isBufferAvailable () const noexcept
     
    void recv ()
     
    void release ()
     
    void reset () override
     
    void sendAdvTimestamp ()
     
    void setCallbackAfterRecv (dw::core::Function< dwStatus()> callback)
     
    - Public Member Functions inherited from dw::framework::ManagedPortBase
    virtual void bindChannel (ChannelObject *channel)=0
     
    void bindLockstepSyncClient (dw::framework::lockstep::ILockstepSyncClient *syncClient)
     
    ChannelObjectgetChannel ()
     
    virtual bool isBound () const noexcept=0
     
     ManagedPortBase ()
     
     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)
     
    void setPeriod (uint32_t period)
     
    virtual ~ManagedPortBase ()=default
     
    - Public Member Functions inherited from dw::framework::PortBase
    virtual ~PortBase ()=default
     

    Protected Member Functions

    GenericData getBufferGeneric () const
     
     ManagedPortInputBase (ConstructProperties props, GenericDataReference &&ref)
     
    GenericData popBufferGeneric ()
     
    void releaseToChannel (void *data)
     

    Protected Attributes

    RingBuffer m_buffers
     
    GenericData m_stashedFuturePacket
     
    bool m_stashValid
     
    - Protected Attributes inherited from dw::framework::ManagedPortBase
    ChannelObjectm_channel
     
    uint32_t m_cycleCount
     
    dw::framework::lockstep::ILockstepSyncClientm_lockstepSyncClient
     
    uint32_t m_period
     

    Class Documentation

    ◆ dw::framework::ManagedPortInputBase::BoundProperties

    struct dw::framework::ManagedPortInputBase::BoundProperties
    Class Members
    uint32_t dataOffset

    Offset from when an incoming packet was produced to the current cycle that must elapse before a packet can be releaesd to a consumer.

    bool enableReuse

    If all buffers have been released and there are no new buffers available on channel since recv() was last called, enableReuse will allow the last buffer acquired from the channel to be returned. Only 1 buffer will be re-usable in case multiple buffers were last acquired.

    TODO(chale): move this to ConstructProperties once properties are passed by node instead of via channel.

    bool syncEnabled

    Whether this port is a sync port and will validate a packet's cycle counter.

    ◆ dw::framework::ManagedPortInputBase::ConstructProperties

    struct dw::framework::ManagedPortInputBase::ConstructProperties
    Class Members
    uint32_t maxBuffers

    The maximum number of buffers this port can acquire at once.

    dwTime_t waitTime

    When recv() is called, calling thread will block at least waitTime number of us for a packet to arrive on the channel. TODO(chale): move to BoundProperties once it is supported.

    ◆ dw::framework::ManagedPortInputBase::Properties

    struct dw::framework::ManagedPortInputBase::Properties
    Collaboration diagram for dw::framework::ManagedPortInputBase::Properties:
    Class Members
    BoundProperties boundProperties

    Properties deduced once port is bound to channel.

    ConstructProperties constructProperties

    Properties deduced when port is constructed.

    Member Typedef Documentation

    ◆ RingBuffer

    Definition at line 210 of file ManagedPort.hpp.

    Constructor & Destructor Documentation

    ◆ ManagedPortInputBase()

    dw::framework::ManagedPortInputBase::ManagedPortInputBase ( ConstructProperties  props,
    GenericDataReference &&  ref 
    )
    protected

    Member Function Documentation

    ◆ bindChannel()

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

    ◆ getBufferGeneric()

    GenericData dw::framework::ManagedPortInputBase::getBufferGeneric ( ) const
    protected

    ◆ getMetadata()

    const ChannelMetadata & dw::framework::ManagedPortInputBase::getMetadata ( )

    Get the metadata of the acquired buffer.

    Returns
    header of the acquired buffer

    ◆ getProperties()

    const Properties & dw::framework::ManagedPortInputBase::getProperties ( ) const
    noexcept
    Returns
    Get the properties to initialize the port.

    ◆ isBound()

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

    ◆ isBufferAvailable()

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

    ◆ popBufferGeneric()

    GenericData dw::framework::ManagedPortInputBase::popBufferGeneric ( )
    protected

    ◆ recv()

    void dw::framework::ManagedPortInputBase::recv ( )

    Receive buffers from the channel

    Note
    client should check after with isBufferAvailable() to know if a buffer was actually received.
    when no buffers are available on the channel, this call will block waiting a buffer to arrive. (wait time given by properties)
    once a buffers has arrived on channel, port will attempt to receive buffers until there are no more available or the maximum number has been received (max number given by properties)
    Exceptions
    whenunexpected error is received from channel or when buffers were already received (and not released).

    ◆ release()

    void dw::framework::ManagedPortInputBase::release ( )

    Release buffers to the channel

    Note
    when no buffers had previously been received this operation is a no-op.
    Exceptions
    whenunexpected error is received from channel.

    ◆ releaseToChannel()

    void dw::framework::ManagedPortInputBase::releaseToChannel ( void *  data)
    protected

    ◆ reset()

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

    Return all buffers to the channel as release() does, but also returns buffers held for re-use.

    Note
    does not drop the bound channel. Resets the input's port cycle count to 0.

    Reimplemented from dw::framework::ManagedPortBase.

    ◆ sendAdvTimestamp()

    void dw::framework::ManagedPortInputBase::sendAdvTimestamp ( )

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

    ◆ setCallbackAfterRecv()

    void dw::framework::ManagedPortInputBase::setCallbackAfterRecv ( dw::core::Function< dwStatus()>  callback)

    Set callback function to be invoked after receiving the new data. Note that the callback won't be called if the data is reused.

    Member Data Documentation

    ◆ m_buffers

    RingBuffer dw::framework::ManagedPortInputBase::m_buffers
    protected

    Definition at line 343 of file ManagedPort.hpp.

    ◆ m_stashedFuturePacket

    GenericData dw::framework::ManagedPortInputBase::m_stashedFuturePacket
    protected

    Definition at line 344 of file ManagedPort.hpp.

    ◆ m_stashValid

    bool dw::framework::ManagedPortInputBase::m_stashValid
    protected

    Definition at line 345 of file ManagedPort.hpp.


    The documentation for this class was generated from the following file:
    人人超碰97caoporen国产