Compute Graph Framework SDK Reference  5.10
dw::framework::ChannelFactory Class Reference

Detailed Description

Shared allocator and context for Channels.

Definition at line 69 of file ChannelFactory.hpp.

Inheritance diagram for dw::framework::ChannelFactory:

Public Types

using OnDispatchDataReady = dw::core::Function< void(void *opaque, ChannelObject::PacketPool::OnDataReady)>
 

Public Member Functions

 ChannelFactory (dwContextHandle_t ctx=DW_NULL_HANDLE)
 Construct a new Channel Factory object. More...
 
bool getEvent (ChannelEvent &event, dwTime_t timeout)
 
NvSciSyncModule getNvSciSyncModule ()
 
ChannelPacketFactoryPtr getPacketFactory ()
 
std::shared_ptr< ChannelObjectmakeChannel (const char *channelParams)
 
void setOnDispatchDataReady (OnDispatchDataReady dispatchDataReady)
 
void startServices ()
 
void stopServices ()
 
virtual ~ChannelFactory ()=default
 

Static Public Member Functions

static void registerPacketConstructor (const ChannelPacketConstructorSignature &signature, const ChannelPacketConstructor &constructor)
 
static void unregisterPacketConstructor (const ChannelPacketConstructorSignature &signature)
 

Member Typedef Documentation

◆ OnDispatchDataReady

Definition at line 137 of file ChannelFactory.hpp.

Constructor & Destructor Documentation

◆ ChannelFactory()

dw::framework::ChannelFactory::ChannelFactory ( dwContextHandle_t  ctx = DW_NULL_HANDLE)

Construct a new Channel Factory object.

Parameters
ctxthe DriveWorks context

◆ ~ChannelFactory()

virtual dw::framework::ChannelFactory::~ChannelFactory ( )
virtualdefault

Member Function Documentation

◆ getEvent()

bool dw::framework::ChannelFactory::getEvent ( ChannelEvent event,
dwTime_t  timeout 
)

Get the oldest event.

Note
this method is not thread-safe.
Parameters
[out]eventevent to wait for
[in]timeouttimeout for the wait
Returns
true if successful false if no event came

◆ getNvSciSyncModule()

NvSciSyncModule dw::framework::ChannelFactory::getNvSciSyncModule ( )

◆ getPacketFactory()

ChannelPacketFactoryPtr dw::framework::ChannelFactory::getPacketFactory ( )

◆ makeChannel()

std::shared_ptr< ChannelObject > dw::framework::ChannelFactory::makeChannel ( const char *  channelParams)

Create a Channel

Parameters
channelParamsthe parameters of the Channel
Returns
std::shared_ptr<ChannelObject>

◆ registerPacketConstructor()

static void dw::framework::ChannelFactory::registerPacketConstructor ( const ChannelPacketConstructorSignature signature,
const ChannelPacketConstructor constructor 
)
static

Register a packet constructor to the factory.

Note
A packet class must be registered to the ChannelFactory before a corresponding ChannelObject which the application intends to use with said packet class is created.
Thread-safe
init-time only
Parameters
signatureThe signature under chich to register the constructor.
constructorThe constructor to register.

◆ setOnDispatchDataReady()

void dw::framework::ChannelFactory::setOnDispatchDataReady ( OnDispatchDataReady  dispatchDataReady)

◆ startServices()

void dw::framework::ChannelFactory::startServices ( )

Start the background services of the Channels.

Note
Until services are started, Channels may not properly connect or get notified when new data is ready.
Performance to create Channels will be very slow due to contention of background services. Hence it is recommended to create all Channels before starting services.
Not Yet Implemented.

◆ stopServices()

void dw::framework::ChannelFactory::stopServices ( )

Stop the background services of the Channels.

Note
While services are stopped, Channels may not properly be able to get notified when new data is ready.
Performance to delete Channels will be very slow due to contention of background services. Hence it is recommended to stop services before deleting any Channels.

◆ unregisterPacketConstructor()

static void dw::framework::ChannelFactory::unregisterPacketConstructor ( const ChannelPacketConstructorSignature signature)
static

Unregister a packet constructor from the factory.

Note
Thread-safe
deinit-time only
Parameters
signatureThe signature to unregister.

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