CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::TypedWritePort< T, SkipTypeCheck > Class Template Reference

#include <TypedPorts.h>

Inheritance diagram for esi::TypedWritePort< T, SkipTypeCheck >:
Collaboration diagram for esi::TypedWritePort< T, SkipTypeCheck >:

Public Types

using DataFetchCallback = std::function<std::unique_ptr<T>()>
 Callback mode data source: returns the next value to write, or nullptr if none is available yet.

Public Member Functions

 TypedWritePort (WriteChannelPort &port)
 TypedWritePort (WriteChannelPort *port)
void connect (const ChannelPort::ConnectOptions &opts={std::nullopt, false})
void connect (DataFetchCallback fetch, WriteChannelPort::WriteErrorCallback onError, const ChannelPort::ConnectOptions &opts={std::nullopt, false})
 Connect in callback mode.
void notifyAsyncDataAvailable ()
 See WriteChannelPort::notifyAsyncDataAvailable().
void write (const T &data)
void write (std::unique_ptr< T > &data)
 Write by taking ownership.
bool tryWrite (const T &data)
bool tryWrite (std::unique_ptr< T > &data)
 Non-blocking write by taking ownership.
bool flush ()
void disconnect ()
bool isConnected () const
WriteChannelPort & raw ()
const WriteChannelPort & raw () const

Private Attributes

WriteChannelPort * inner
WireInfo wireInfo_

Detailed Description

template<typename T, bool SkipTypeCheck = false>
class esi::TypedWritePort< T, SkipTypeCheck >

Definition at line 604 of file TypedPorts.h.

Member Typedef Documentation

◆ DataFetchCallback

template<typename T, bool SkipTypeCheck = false>
using esi::TypedWritePort< T, SkipTypeCheck >::DataFetchCallback = std::function<std::unique_ptr<T>()>

Callback mode data source: returns the next value to write, or nullptr if none is available yet.

See WriteChannelPort::DataFetchCallback.

Definition at line 622 of file TypedPorts.h.

Constructor & Destructor Documentation

◆ TypedWritePort() [1/2]

template<typename T, bool SkipTypeCheck = false>
esi::TypedWritePort< T, SkipTypeCheck >::TypedWritePort ( WriteChannelPort & port)
inlineexplicit

Definition at line 606 of file TypedPorts.h.

References inner.

◆ TypedWritePort() [2/2]

template<typename T, bool SkipTypeCheck = false>
esi::TypedWritePort< T, SkipTypeCheck >::TypedWritePort ( WriteChannelPort * port)
inline

Definition at line 608 of file TypedPorts.h.

References inner.

Member Function Documentation

◆ connect() [1/2]

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::connect ( const ChannelPort::ConnectOptions & opts = {std::nullopt, false})
inline

◆ connect() [2/2]

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::connect ( DataFetchCallback fetch,
WriteChannelPort::WriteErrorCallback onError,
const ChannelPort::ConnectOptions & opts = {std::nullopt, false} )
inline

Connect in callback mode.

If T is a SegmentedMessageData, fetched messages are handed to the port as-is; otherwise they are serialized. See WriteChannelPort::connect(DataFetchCallback, WriteErrorCallback, const ConnectOptions &).

Definition at line 629 of file TypedPorts.h.

◆ disconnect()

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::disconnect ( )
inline

Definition at line 708 of file TypedPorts.h.

References inner.

Referenced by autoSerialCoordTranslateTest(), and serialCoordTranslateTest().

◆ flush()

template<typename T, bool SkipTypeCheck = false>
bool esi::TypedWritePort< T, SkipTypeCheck >::flush ( )
inline

Definition at line 707 of file TypedPorts.h.

References inner.

◆ isConnected()

template<typename T, bool SkipTypeCheck = false>
bool esi::TypedWritePort< T, SkipTypeCheck >::isConnected ( ) const
inline

Definition at line 709 of file TypedPorts.h.

References inner.

◆ notifyAsyncDataAvailable()

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::notifyAsyncDataAvailable ( )
inline

See WriteChannelPort::notifyAsyncDataAvailable().

Definition at line 658 of file TypedPorts.h.

References inner.

◆ raw() [1/2]

template<typename T, bool SkipTypeCheck = false>
WriteChannelPort & esi::TypedWritePort< T, SkipTypeCheck >::raw ( )
inline

Definition at line 711 of file TypedPorts.h.

References inner.

◆ raw() [2/2]

template<typename T, bool SkipTypeCheck = false>
const WriteChannelPort & esi::TypedWritePort< T, SkipTypeCheck >::raw ( ) const
inline

Definition at line 712 of file TypedPorts.h.

References inner.

◆ tryWrite() [1/2]

template<typename T, bool SkipTypeCheck = false>
bool esi::TypedWritePort< T, SkipTypeCheck >::tryWrite ( const T & data)
inline

Definition at line 675 of file TypedPorts.h.

References inner, esi::toMessageData(), and wireInfo_.

Referenced by tryWrite().

◆ tryWrite() [2/2]

template<typename T, bool SkipTypeCheck = false>
bool esi::TypedWritePort< T, SkipTypeCheck >::tryWrite ( std::unique_ptr< T > & data)
inline

Non-blocking write by taking ownership.

On success, data is consumed (left null) and true is returned. On failure, data is left untouched so the caller can retry. If T is a SegmentedMessageData, this hands the message directly to the port's segmented tryWrite path.

Definition at line 683 of file TypedPorts.h.

References inner, and tryWrite().

◆ write() [1/2]

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::write ( const T & data)
inline

◆ write() [2/2]

template<typename T, bool SkipTypeCheck = false>
void esi::TypedWritePort< T, SkipTypeCheck >::write ( std::unique_ptr< T > & data)
inline

Write by taking ownership.

If T is a SegmentedMessageData, this hands the message directly to the port's segmented write path.

Definition at line 664 of file TypedPorts.h.

References inner, and write().

Member Data Documentation

◆ inner

template<typename T, bool SkipTypeCheck = false>
WriteChannelPort* esi::TypedWritePort< T, SkipTypeCheck >::inner
private

◆ wireInfo_

template<typename T, bool SkipTypeCheck = false>
WireInfo esi::TypedWritePort< T, SkipTypeCheck >::wireInfo_
private

Definition at line 716 of file TypedPorts.h.

Referenced by tryWrite(), and write().


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