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

dw::framework::SensorNode Class Referenceabstract

Detailed Description

Definition at line 198 of file Node.hpp.

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

Data Structures

struct  DataEvent
 Record of data sensor data frame. More...
 

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 >
 

Public Member Functions

virtual dwStatus getHealthSignals (dwGraphHealthSignalArray *&healthSignals)=0
 Get the pointer to the health signal array for this node. More...
 
virtual dwStatus getName (const char **name)=0
 Get the name of the node. More...
 
virtual size_t getPassCount () const noexcept=0
 Get number of passes in the node. More...
 
virtual dwStatus getPasses (VectorFixed< Pass *> &passList)=0
 Get all the passes in the node. More...
 
virtual dwStatus getPasses (VectorFixed< Pass *> &passList, dwProcessorType processorType, dwProcessType processType)=0
 Get node passes filtered by processor type and process type. More...
 
virtual dwStatus isVirtual (bool *isVirtualBool)=0
 distinguishes between a live and virtual sensor More...
 
virtual dwStatus reset ()=0
 Resets the state of the node. More...
 
virtual dwStatus run ()=0
 Runs all the passes in the node. More...
 
virtual dwStatus runPass (size_t passIndex)=0
 Run one pass by index as defined by the pass descriptors. More...
 
virtual dwStatus runPassByID (uint8_t passID)=0
 Run one pass by ID as defined by the PassList enum class. More...
 
virtual dwStatus setAffinityMask (uint)=0
 Sets the affinity mask of the sensor. More...
 
virtual dwStatus setDataEventReadCallback (DataEventReadCallback cb)=0
 Set read timestamp function for dataset replay. More...
 
virtual dwStatus setDataEventWriteCallback (DataEventWriteCallback cb)=0
 Set write timestamp function for live case. More...
 
virtual dwStatus setEndTime (dwTime_t)=0
 Set end timestamp for dataset replay. More...
 
virtual dwStatus setInputChannel (ChannelObject *channel, uint8_t portID)=0
 Sets an input channel for this node with an accompanying port. More...
 
virtual dwStatus setInputChannel (ChannelObject *channel, uint8_t portID, dwSerializationType dataType)=0
 Sets an input channel for this node with an accompanying port. More...
 
virtual dwStatus setIterationCount (uint32_t iterationCount)=0
 Sets the node's iteration count. More...
 
virtual dwStatus setName (const char *name)=0
 Set the name of the node. More...
 
virtual dwStatus setOutputChannel (ChannelObject *channel, uint8_t portID)=0
 Sets an output channel for this node with an accompanying port. More...
 
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 start ()=0
 Start the sensor. More...
 
virtual dwStatus stop ()=0
 Stop the sensor. More...
 
virtual dwStatus validate ()=0
 Checks that all mandatory ports are bound. More...
 
 ~SensorNode () override=default
 

Static Public Attributes

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()
 

Data Structure Documentation

◆ dw::framework::SensorNode::DataEvent

struct dw::framework::SensorNode::DataEvent
Data Fields
DataEventType dataEventType The type of event.
dwStatus status The status of the node-run.

invalid if dataEventType is DROP DW_SUCCESS if the node-run produced data. DW_TIME_OUT, DW_NOT_AVAILABLE, etc, sensor had not data for node-run. DW_END_OF_STREAM if sensor reached end of stream.

dwTime_t timestamp The timestamp of involved data.

invalid if dataEventType is NONE.

Member Typedef Documentation

◆ DataEventReadCallback

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

Definition at line 276 of file Node.hpp.

◆ DataEventWriteCallback

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.

Member Enumeration Documentation

◆ DataEventType

Enumerator
PRODUCE 
DROP 
NONE 

Definition at line 245 of file Node.hpp.

Constructor & Destructor Documentation

◆ ~SensorNode()

dw::framework::SensorNode::~SensorNode ( )
overridedefault

Member Function Documentation

◆ getHealthSignals()

virtual dwStatus dw::framework::Node::getHealthSignals ( dwGraphHealthSignalArray *&  healthSignals)
pure virtualinherited

Get the pointer to the health signal array for this node.

Parameters
healthSignalsThe health signal array.
Returns
DW_SUCCESS

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getName()

virtual dwStatus dw::framework::Node::getName ( const char **  name)
pure virtualinherited

Get the name of the node.

Parameters
nameThe output name.
Returns
DW_SUCCESS, DW_INVALID_ARUGMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getPassCount()

virtual size_t dw::framework::Node::getPassCount ( ) const
pure virtualnoexceptinherited

◆ getPasses() [1/2]

virtual dwStatus dw::framework::Node::getPasses ( VectorFixed< Pass *> &  passList)
pure virtualinherited

Get all the passes in the node.

Parameters
passListThe output list to populate.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ getPasses() [2/2]

virtual dwStatus dw::framework::Node::getPasses ( VectorFixed< Pass *> &  passList,
dwProcessorType  processorType,
dwProcessType  processType 
)
pure virtualinherited

Get node passes filtered by processor type and process type.

Parameters
passListThe output list to populate.
processorTypeFilter by this processor type.
processTypeFilter by this process type.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ isVirtual()

virtual dwStatus dw::framework::SensorNode::isVirtual ( bool *  isVirtualBool)
pure virtual

distinguishes between a live and virtual sensor

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleSensorNode, and dw::framework::ExceptionSafeSensorNode.

◆ reset()

virtual dwStatus dw::framework::Node::reset ( )
pure virtualinherited

◆ run()

virtual dwStatus dw::framework::Node::run ( )
pure virtualinherited

◆ runPass()

virtual dwStatus dw::framework::Node::runPass ( size_t  passIndex)
pure virtualinherited

Run one pass by index as defined by the pass descriptors.

Parameters
passIndexThe index of the pass to run.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT, DW_FAILURE

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ runPassByID()

virtual dwStatus dw::framework::Node::runPassByID ( uint8_t  passID)
pure virtualinherited

Run one pass by ID as defined by the PassList enum class.

Parameters
passIDThe ID of the pass to run.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT, DW_FAILURE

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setAffinityMask()

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

Sets the affinity mask of the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setDataEventReadCallback()

virtual dwStatus dw::framework::SensorNode::setDataEventReadCallback ( DataEventReadCallback  cb)
pure virtual

Set read timestamp function for dataset replay.

Timestamps not in the sequence returned by the callback will be dropped.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleSensorNode, and dw::framework::ExceptionSafeSensorNode.

◆ setDataEventWriteCallback()

virtual dwStatus dw::framework::SensorNode::setDataEventWriteCallback ( DataEventWriteCallback  cb)
pure virtual

Set write timestamp function for live case.

Each timestamp of data output from the node will be passed to this callback.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleSensorNode, and dw::framework::ExceptionSafeSensorNode.

◆ setEndTime()

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

Set end timestamp for dataset replay.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ setInputChannel() [1/2]

virtual dwStatus dw::framework::Node::setInputChannel ( ChannelObject channel,
uint8_t  portID 
)
pure virtualinherited

Sets an input channel for this node with an accompanying port.

Parameters
channelThe channel to bind to the portID.
portIDThe port to bind the channel with.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setInputChannel() [2/2]

virtual dwStatus dw::framework::Node::setInputChannel ( ChannelObject channel,
uint8_t  portID,
dwSerializationType  dataType 
)
pure virtualinherited

Sets an input channel for this node with an accompanying port.

Parameters
channelThe channel to bind to the portID.
portIDThe port to bind the channel with.
dataTypeThe type of data received by this node from the channel
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setIterationCount()

virtual dwStatus dw::framework::Node::setIterationCount ( uint32_t  iterationCount)
pure virtualinherited

Sets the node's iteration count.

Parameters
iterationCountThe current iteration count
Returns
DW_SUCCESS

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::SimpleNode, dw::framework::ExceptionSafeSensorNode, and dw::framework::ExceptionSafeProcessNode.

◆ setName()

virtual dwStatus dw::framework::Node::setName ( const char *  name)
pure virtualinherited

Set the name of the node.

Parameters
nameThe name of the node.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setOutputChannel()

virtual dwStatus dw::framework::Node::setOutputChannel ( ChannelObject channel,
uint8_t  portID 
)
pure virtualinherited

Sets an output channel for this node with an accompanying port.

Parameters
channelThe channel to bind to the portID.
portIDThe port to bind the channel with.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setStartTime()

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

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 virtual

Sets the thread priority of the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeSensorNode.

◆ start()

virtual dwStatus dw::framework::SensorNode::start ( )
pure virtual

Start the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleSensorNode, and dw::framework::ExceptionSafeSensorNode.

◆ stop()

virtual dwStatus dw::framework::SensorNode::stop ( )
pure virtual

Stop the sensor.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleSensorNode, and dw::framework::ExceptionSafeSensorNode.

◆ validate()

virtual dwStatus dw::framework::Node::validate ( )
pure virtualinherited

Checks that all mandatory ports are bound.

The implementation should validate that all the ports are bound to the appropriate channels (any required ports, that is). For example, a camera node may have processed output and raw output ports, but only one is required to be bound.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::SimpleProcessNode, dw::framework::SimpleSensorNode, dw::framework::SimpleProcessNodeT< T >, dw::framework::ExceptionSafeSensorNode, dw::framework::SimpleSensorNodeT< T >, dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

Field Documentation

◆ 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: