Compute Graph Framework SDK Reference
5.4.5418 Release
For Test and Development only

dw::framework::SimpleSensorNodeT< T > Class Template Referenceabstract

Detailed Description

template<typename T>
class dw::framework::SimpleSensorNodeT< T >

Definition at line 114 of file SimpleNodeT.hpp.

Inheritance diagram for dw::framework::SimpleSensorNodeT< T >:
dw::framework::SimpleSensorNode dw::framework::SimpleNodeT< T > dw::framework::SensorNode dw::framework::Node

Public Types

using DataEventReadCallback = dw::core::Function< bool(DataEvent &)>
 
enum  DataEventType {
  DataEventType::PRODUCE,
  DataEventType::DROP,
  DataEventType::NONE
}
 
using DataEventWriteCallback = dw::core::Function< void(DataEvent)>
 
using Name_t = FixedString< MAX_NAME_LEN >
 
using NodeT = T
 

Public Member Functions

std::unique_ptr< PasscreateSetupPass () override
 
std::unique_ptr< PasscreateTeardownPass () override
 
dwStatus getHealthSignals (dwGraphHealthSignalArray *&healthSignals) override
 
template<typename NodeT , size_t PortIndex>
auto & getInputPort ()
 
template<typename NodeT , size_t PortIndex>
auto & getInputPort (size_t arrayIndex)
 
uint32_t getIterationCount () const
 
dwStatus getName (const char **name) override
 
template<typename NodeT , size_t PortIndex>
auto & getOutputPort ()
 
template<typename NodeT , size_t PortIndex>
auto & getOutputPort (size_t arrayIndex)
 
size_t getPassCount () const noexcept override
 
dwStatus getPasses (VectorFixed< Pass *> &passList) override
 
dwStatus getPasses (VectorFixed< Pass *> &passList, dwProcessorType processorType, dwProcessType processType) override
 
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > & getRegisteredInputPorts () const
 
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > & getRegisteredOutputPorts () const
 
template<typename NodeT , size_t PortIndex, typename... Args>
void initInputArrayPort (Args &&... args)
 
template<typename NodeT , size_t PortIndex, typename... Args>
void initInputPort (Args &&... args)
 
template<typename NodeT , size_t PortIndex, typename... Args>
void initOutputArrayPort (Args &&... args)
 
template<typename NodeT , size_t PortIndex, typename... Args>
void initOutputPort (Args &&... args)
 
dwStatus isVirtual (bool *) override
 
template<typename TPort , typename... Args>
auto make_port (Args &&... args)
 
dwStatus reset () override
 The default implementation calls SimpleNode::resetPorts. More...
 
dwStatus run () override
 
dwStatus runPass (size_t passIndex) override
 
dwStatus runPassByID (uint8_t passID) override
 
virtual dwStatus setAffinityMask (uint)=0
 Sets the affinity mask of the sensor. More...
 
dwStatus setDataEventReadCallback (DataEventReadCallback) override
 
dwStatus setDataEventWriteCallback (DataEventWriteCallback) override
 
virtual dwStatus setEndTime (dwTime_t)=0
 Set end timestamp for dataset replay. More...
 
dwStatus setInputChannel (ChannelObject *channel, uint8_t portID) override
 
dwStatus setInputChannel (ChannelObject *channel, uint8_t portID, dwSerializationType serialType) override
 
dwStatus setIterationCount (uint32_t iterationCount) override
 
dwStatus setName (const char *name) override
 
dwStatus setOutputChannel (ChannelObject *channel, uint8_t portID) override
 
virtual dwStatus setStartTime (dwTime_t)=0
 Set start timestamp for dataset replay. More...
 
virtual dwStatus setThreadPriority (int)=0
 Sets the thread priority of the sensor. More...
 
virtual dwStatus setupImpl ()
 The default implementation calls SimpleNode::setup. More...
 
 SimpleSensorNodeT ()
 Default constructor registering the setup and teardown passes. More...
 
 SimpleSensorNodeT (NodeAllocationParams params)
 
dwStatus start () override
 
dwStatus stop () override
 
virtual dwStatus teardownImpl ()
 The default implementation calls SimpleNode::teardown. More...
 
dwStatus validate () override
 Validate that all registered ports which have the flag binding-required are bound to a channel. More...
 
dwStatus validate (const char *direction, const PortCollectionDescriptor &collection, const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase >> &ports, size_t indexOffset=0)
 

Static Public Attributes

static constexpr char LOG_TAG [] = "SimpleSensorNode"
 
static constexpr size_t MAX_NAME_LEN = 128
 
static constexpr uint32_t MAX_PASS_COUNT = 256
 
static constexpr uint32_t MAX_PORT_COUNT = 256
 
static constexpr uint8_t PASS_SETUP = std::numeric_limits<uint8_t>::max() - 1
 
static constexpr uint8_t PASS_TEARDOWN = std::numeric_limits<uint8_t>::max()
 

Protected Member Functions

dwStatus addHealthSignal (const dwGraphHealthSignal &signal)
 
void addPass (Pass *pass)
 
dwStatus clearHealthSignals ()
 
template<typename PassFunctionT , typename... Args>
std::unique_ptr< PassImpl< PassFunctionT > > make_pass (PassFunctionT func, Args &&... args)
 
template<typename NodeT , size_t PassIndex, typename PassFunctionT >
void registerPass (PassFunctionT func, NvMediaDla *dlaEngine=nullptr)
 
void resetPorts ()
 
template<typename ModuleHandle_t >
dwStatus setModuleHandle (ModuleHandle_t handle, dwContextHandle_t context)
 
dwStatus setObjectHandle (dwModuleHandle_t handle)
 
dwStatus setup ()
 
dwStatus teardown ()
 

Protected Attributes

std::atomic< bool > m_asyncResetFlag
 

Member Typedef Documentation

◆ DataEventReadCallback

using dw::framework::SensorNode::DataEventReadCallback = dw::core::Function<bool(DataEvent&)>
inherited

Definition at line 276 of file Node.hpp.

◆ DataEventWriteCallback

using dw::framework::SensorNode::DataEventWriteCallback = dw::core::Function<void(DataEvent)>
inherited

Definition at line 285 of file Node.hpp.

◆ Name_t

using dw::framework::Node::Name_t = FixedString<MAX_NAME_LEN>
inherited

Definition at line 67 of file Node.hpp.

◆ NodeT

template<typename T >
using dw::framework::SimpleSensorNodeT< T >::NodeT = T

Definition at line 117 of file SimpleNodeT.hpp.

Member Enumeration Documentation

◆ DataEventType

Enumerator
PRODUCE 
DROP 
NONE 

Definition at line 245 of file Node.hpp.

Constructor & Destructor Documentation

◆ SimpleSensorNodeT() [1/2]

template<typename T >
dw::framework::SimpleSensorNodeT< T >::SimpleSensorNodeT ( )
inline

Default constructor registering the setup and teardown passes.

Definition at line 120 of file SimpleNodeT.hpp.

◆ SimpleSensorNodeT() [2/2]

template<typename T >
dw::framework::SimpleSensorNodeT< T >::SimpleSensorNodeT ( NodeAllocationParams  params)
inline

Definition at line 126 of file SimpleNodeT.hpp.

Member Function Documentation

◆ addHealthSignal()

dwStatus dw::framework::SimpleSensorNode::addHealthSignal ( const dwGraphHealthSignal signal)
protectedinherited

◆ addPass()

void dw::framework::SimpleSensorNode::addPass ( Pass pass)
protectedinherited

◆ clearHealthSignals()

dwStatus dw::framework::SimpleSensorNode::clearHealthSignals ( )
protectedinherited

◆ createSetupPass()

template<typename T >
std::unique_ptr<Pass> dw::framework::SimpleSensorNodeT< T >::createSetupPass ( )
inlineoverridevirtual
Deprecated:
When using SimpleProcessNodeT as the base class for a concrete node this methods shouldn't be invoked since the base class provides a default implementation for the setup pass in SimpleProcessNodeT::setupImpl.

Reimplemented from dw::framework::SimpleSensorNode.

Definition at line 134 of file SimpleNodeT.hpp.

◆ createTeardownPass()

template<typename T >
std::unique_ptr<Pass> dw::framework::SimpleSensorNodeT< T >::createTeardownPass ( )
inlineoverridevirtual
Deprecated:
When using SimpleProcessNodeT as the base class for a concrete node this methods shouldn't be invoked since the base class provides a default implementation for the setup pass in SimpleProcessNodeT::teardownImpl.

Reimplemented from dw::framework::SimpleSensorNode.

Definition at line 141 of file SimpleNodeT.hpp.

◆ getHealthSignals()

dwStatus dw::framework::SimpleSensorNode::getHealthSignals ( dwGraphHealthSignalArray *&  healthSignals)
overridevirtualinherited

Implements dw::framework::Node.

◆ getInputPort() [1/2]

template<typename NodeT , size_t PortIndex>
auto& dw::framework::SimpleSensorNode::getInputPort ( )
inlineinherited

Definition at line 724 of file SimpleNode.hpp.

◆ getInputPort() [2/2]

template<typename NodeT , size_t PortIndex>
auto& dw::framework::SimpleSensorNode::getInputPort ( size_t  arrayIndex)
inlineinherited

Definition at line 730 of file SimpleNode.hpp.

◆ getIterationCount()

uint32_t dw::framework::SimpleSensorNode::getIterationCount ( ) const
inlineinherited

Definition at line 762 of file SimpleNode.hpp.

◆ getName()

dwStatus dw::framework::SimpleSensorNode::getName ( const char **  name)
overridevirtualinherited

Implements dw::framework::Node.

◆ getOutputPort() [1/2]

template<typename NodeT , size_t PortIndex>
auto& dw::framework::SimpleSensorNode::getOutputPort ( )
inlineinherited

Definition at line 736 of file SimpleNode.hpp.

◆ getOutputPort() [2/2]

template<typename NodeT , size_t PortIndex>
auto& dw::framework::SimpleSensorNode::getOutputPort ( size_t  arrayIndex)
inlineinherited

Definition at line 742 of file SimpleNode.hpp.

◆ getPassCount()

size_t dw::framework::SimpleSensorNode::getPassCount ( ) const
overridevirtualnoexceptinherited

Implements dw::framework::Node.

◆ getPasses() [1/2]

dwStatus dw::framework::SimpleSensorNode::getPasses ( VectorFixed< Pass *> &  passList)
overridevirtualinherited

Implements dw::framework::Node.

◆ getPasses() [2/2]

dwStatus dw::framework::SimpleSensorNode::getPasses ( VectorFixed< Pass *> &  passList,
dwProcessorType  processorType,
dwProcessType  processType 
)
overridevirtualinherited

Implements dw::framework::Node.

◆ getRegisteredInputPorts()

const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase> >& dw::framework::SimpleSensorNode::getRegisteredInputPorts ( ) const
inlineinherited

Definition at line 747 of file SimpleNode.hpp.

◆ getRegisteredOutputPorts()

const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase> >& dw::framework::SimpleSensorNode::getRegisteredOutputPorts ( ) const
inlineinherited

Definition at line 752 of file SimpleNode.hpp.

◆ initInputArrayPort()

template<typename NodeT , size_t PortIndex, typename... Args>
void dw::framework::SimpleSensorNode::initInputArrayPort ( Args &&...  args)
inlineinherited

Definition at line 706 of file SimpleNode.hpp.

◆ initInputPort()

template<typename NodeT , size_t PortIndex, typename... Args>
void dw::framework::SimpleSensorNode::initInputPort ( Args &&...  args)
inlineinherited

Definition at line 700 of file SimpleNode.hpp.

◆ initOutputArrayPort()

template<typename NodeT , size_t PortIndex, typename... Args>
void dw::framework::SimpleSensorNode::initOutputArrayPort ( Args &&...  args)
inlineinherited

Definition at line 718 of file SimpleNode.hpp.

◆ initOutputPort()

template<typename NodeT , size_t PortIndex, typename... Args>
void dw::framework::SimpleSensorNode::initOutputPort ( Args &&...  args)
inlineinherited

Definition at line 712 of file SimpleNode.hpp.

◆ isVirtual()

dwStatus dw::framework::SimpleSensorNode::isVirtual ( bool *  )
inlineoverridevirtualinherited

Implements dw::framework::SensorNode.

Definition at line 603 of file SimpleNode.hpp.

◆ make_pass()

template<typename PassFunctionT , typename... Args>
std::unique_ptr<PassImpl<PassFunctionT> > dw::framework::SimpleSensorNode::make_pass ( PassFunctionT  func,
Args &&...  args 
)
inlineprotectedinherited

Definition at line 669 of file SimpleNode.hpp.

◆ make_port()

template<typename TPort , typename... Args>
auto dw::framework::SimpleSensorNode::make_port ( Args &&...  args)
inlineinherited

Definition at line 694 of file SimpleNode.hpp.

◆ registerPass()

template<typename NodeT , size_t PassIndex, typename PassFunctionT >
void dw::framework::SimpleSensorNode::registerPass ( PassFunctionT  func,
NvMediaDla *  dlaEngine = nullptr 
)
inlineprotectedinherited

Definition at line 676 of file SimpleNode.hpp.

◆ reset()

template<typename T >
dwStatus dw::framework::SimpleSensorNodeT< T >::reset ( )
inlineoverridevirtual

The default implementation calls SimpleNode::resetPorts.

Reimplemented from dw::framework::SimpleSensorNode.

Definition at line 159 of file SimpleNodeT.hpp.

◆ resetPorts()

void dw::framework::SimpleSensorNode::resetPorts ( )
inlineprotectedinherited

Definition at line 655 of file SimpleNode.hpp.

◆ run()

dwStatus dw::framework::SimpleSensorNode::run ( )
overridevirtualinherited

Implements dw::framework::Node.

◆ runPass()

dwStatus dw::framework::SimpleSensorNode::runPass ( size_t  passIndex)
overridevirtualinherited

Implements dw::framework::Node.

◆ runPassByID()

dwStatus dw::framework::SimpleSensorNode::runPassByID ( uint8_t  passID)
overridevirtualinherited

Implements dw::framework::Node.

◆ setAffinityMask()

virtual dwStatus dw::framework::SensorNode::setAffinityMask ( uint  )
pure virtualinherited

Sets the affinity mask of the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setDataEventReadCallback()

dwStatus dw::framework::SimpleSensorNode::setDataEventReadCallback ( DataEventReadCallback  )
inlineoverridevirtualinherited

Implements dw::framework::SensorNode.

Definition at line 608 of file SimpleNode.hpp.

◆ setDataEventWriteCallback()

dwStatus dw::framework::SimpleSensorNode::setDataEventWriteCallback ( DataEventWriteCallback  )
inlineoverridevirtualinherited

Implements dw::framework::SensorNode.

Definition at line 613 of file SimpleNode.hpp.

◆ setEndTime()

virtual dwStatus dw::framework::SensorNode::setEndTime ( dwTime_t  )
pure virtualinherited

Set end timestamp for dataset replay.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setInputChannel() [1/2]

dwStatus dw::framework::SimpleSensorNode::setInputChannel ( ChannelObject channel,
uint8_t  portID 
)
overridevirtualinherited

Implements dw::framework::Node.

◆ setInputChannel() [2/2]

dwStatus dw::framework::SimpleSensorNode::setInputChannel ( ChannelObject channel,
uint8_t  portID,
dwSerializationType  serialType 
)
overridevirtualinherited

Implements dw::framework::Node.

◆ setIterationCount()

dwStatus dw::framework::SimpleSensorNode::setIterationCount ( uint32_t  iterationCount)
inlineoverridevirtualinherited

Implements dw::framework::Node.

Definition at line 757 of file SimpleNode.hpp.

◆ setModuleHandle()

template<typename ModuleHandle_t >
dwStatus dw::framework::SimpleSensorNode::setModuleHandle ( ModuleHandle_t  handle,
dwContextHandle_t  context 
)
inlineprotectedinherited

Definition at line 661 of file SimpleNode.hpp.

◆ setName()

dwStatus dw::framework::SimpleSensorNode::setName ( const char *  name)
overridevirtualinherited

Implements dw::framework::Node.

◆ setObjectHandle()

dwStatus dw::framework::SimpleSensorNode::setObjectHandle ( dwModuleHandle_t  handle)
protectedinherited

◆ setOutputChannel()

dwStatus dw::framework::SimpleSensorNode::setOutputChannel ( ChannelObject channel,
uint8_t  portID 
)
overridevirtualinherited

Implements dw::framework::Node.

◆ setStartTime()

virtual dwStatus dw::framework::SensorNode::setStartTime ( dwTime_t  )
pure virtualinherited

Set start timestamp for dataset replay.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setThreadPriority()

virtual dwStatus dw::framework::SensorNode::setThreadPriority ( int  )
pure virtualinherited

Sets the thread priority of the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setup()

dwStatus dw::framework::SimpleSensorNode::setup ( )
inlineprotectedinherited

Definition at line 645 of file SimpleNode.hpp.

◆ setupImpl()

template<typename T >
virtual dwStatus dw::framework::SimpleSensorNodeT< T >::setupImpl ( )
inlinevirtual

The default implementation calls SimpleNode::setup.

Definition at line 147 of file SimpleNodeT.hpp.

◆ start()

dwStatus dw::framework::SimpleSensorNode::start ( )
inlineoverridevirtualinherited

Implements dw::framework::SensorNode.

Definition at line 588 of file SimpleNode.hpp.

◆ stop()

dwStatus dw::framework::SimpleSensorNode::stop ( )
inlineoverridevirtualinherited

Implements dw::framework::SensorNode.

Definition at line 593 of file SimpleNode.hpp.

◆ teardown()

dwStatus dw::framework::SimpleSensorNode::teardown ( )
inlineprotectedinherited

Definition at line 650 of file SimpleNode.hpp.

◆ teardownImpl()

template<typename T >
virtual dwStatus dw::framework::SimpleSensorNodeT< T >::teardownImpl ( )
inlinevirtual

The default implementation calls SimpleNode::teardown.

Definition at line 153 of file SimpleNodeT.hpp.

◆ validate() [1/2]

template<typename T >
dwStatus dw::framework::SimpleSensorNodeT< T >::validate ( )
inlineoverridevirtual

Validate that all registered ports which have the flag binding-required are bound to a channel.

Reimplemented from dw::framework::SimpleSensorNode.

Definition at line 166 of file SimpleNodeT.hpp.

References dw::framework::PortCollectionDescriptor::getPortSize(), NODE_REGISTER_PASS, and dw::framework::SimpleSensorNode::validate().

◆ validate() [2/2]

dwStatus dw::framework::SimpleSensorNode::validate ( const char *  direction,
const PortCollectionDescriptor collection,
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase >> &  ports,
size_t  indexOffset = 0 
)
inlineinherited

Definition at line 629 of file SimpleNode.hpp.

Field Documentation

◆ LOG_TAG

constexpr char dw::framework::SimpleSensorNode::LOG_TAG[] = "SimpleSensorNode"
staticinherited

Definition at line 570 of file SimpleNode.hpp.

◆ m_asyncResetFlag

std::atomic<bool> dw::framework::SimpleSensorNode::m_asyncResetFlag
protectedinherited

Definition at line 687 of file SimpleNode.hpp.

◆ MAX_NAME_LEN

constexpr size_t dw::framework::Node::MAX_NAME_LEN = 128
staticinherited

Definition at line 66 of file Node.hpp.

◆ MAX_PASS_COUNT

constexpr uint32_t dw::framework::Node::MAX_PASS_COUNT = 256
staticinherited

Definition at line 71 of file Node.hpp.

◆ MAX_PORT_COUNT

constexpr uint32_t dw::framework::Node::MAX_PORT_COUNT = 256
staticinherited

Definition at line 69 of file Node.hpp.

◆ PASS_SETUP

constexpr uint8_t dw::framework::Node::PASS_SETUP = std::numeric_limits<uint8_t>::max() - 1
staticinherited

Definition at line 72 of file Node.hpp.

◆ PASS_TEARDOWN

constexpr uint8_t dw::framework::Node::PASS_TEARDOWN = std::numeric_limits<uint8_t>::max()
staticinherited

Definition at line 73 of file Node.hpp.


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