Base class encapsulates ownership of buffers and interactions with channel in type-agnostic way.
Definition at line 207 of file ManagedPort.hpp.
Classes | |
struct | BoundProperties |
struct | ConstructProperties |
struct | Properties |
Public Types | |
using | RingBuffer = dw::core::RingBuffer< GenericData > |
Public Member Functions | |
void | bindChannel (ChannelObject *channel) override |
const ChannelMetadata & | getMetadata () |
const Properties & | getProperties () 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) |
![]() | |
virtual void | bindChannel (ChannelObject *channel)=0 |
void | bindLockstepSyncClient (dw::framework::lockstep::ILockstepSyncClient *syncClient) |
ChannelObject * | getChannel () |
virtual bool | isBound () const noexcept=0 |
ManagedPortBase () | |
ManagedPortBase (const ManagedPortBase &other)=delete | |
ManagedPortBase (ManagedPortBase &&other)=delete | |
ManagedPortBase & | operator= (const ManagedPortBase &other)=delete |
ManagedPortBase & | operator= (ManagedPortBase &&other)=delete |
virtual void | reset () |
void | setCycleCount (uint32_t cycleCount) |
void | setPeriod (uint32_t period) |
virtual | ~ManagedPortBase ()=default |
![]() | |
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 |
![]() | |
ChannelObject * | m_channel |
uint32_t | m_cycleCount |
dw::framework::lockstep::ILockstepSyncClient * | m_lockstepSyncClient |
uint32_t | m_period |
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. |
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. |
struct dw::framework::ManagedPortInputBase::Properties |
Class Members | ||
---|---|---|
BoundProperties | boundProperties |
Properties deduced once port is bound to channel. |
ConstructProperties | constructProperties |
Properties deduced when port is constructed. |
using dw::framework::ManagedPortInputBase::RingBuffer = dw::core::RingBuffer<GenericData> |
Definition at line 210 of file ManagedPort.hpp.
|
protected |
|
overridevirtual |
Implements dw::framework::ManagedPortBase.
|
protected |
const ChannelMetadata & dw::framework::ManagedPortInputBase::getMetadata | ( | ) |
Get the metadata of the acquired buffer.
|
noexcept |
|
overridevirtualnoexcept |
Implements dw::framework::ManagedPortBase.
|
noexcept |
|
protected |
void dw::framework::ManagedPortInputBase::recv | ( | ) |
Receive buffers from the channel
when | unexpected error is received from channel or when buffers were already received (and not released). |
void dw::framework::ManagedPortInputBase::release | ( | ) |
Release buffers to the channel
when | unexpected error is received from channel. |
|
protected |
|
overridevirtual |
Return all buffers to the channel as release() does, but also returns buffers held for re-use.
Reimplemented from dw::framework::ManagedPortBase.
void dw::framework::ManagedPortInputBase::sendAdvTimestamp | ( | ) |
Send an advance packet if a lockstep sync client is bound.
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.
|
protected |
Definition at line 343 of file ManagedPort.hpp.
|
protected |
Definition at line 344 of file ManagedPort.hpp.
|
protected |
Definition at line 345 of file ManagedPort.hpp.