Compute Graph Framework SDK Reference  5.12
dw::framework::Node Class Referenceabstract

Detailed Description

Definition at line 65 of file Node.hpp.

Inheritance diagram for dw::framework::Node:

Public Types

using Name_t = FixedString< MAX_NAME_LEN >
 

Public Member Functions

virtual dwStatus clearErrorSignal ()=0
 Clear the error signal for this node. More...
 
virtual dwStatus clearHealthSignal ()=0
 Clear the health signal for this node. More...
 
virtual dwStatus getErrorSignal (dwGraphErrorSignal &sehErrorSignal, dwGraphErrorSignal *&errorSignal, uint16_t const sourceId, char8_t const *instanceName=nullptr)=0
 Get the pointer to the error signal for this node. More...
 
virtual dwStatus getHealthSignal (dwGraphHealthSignal *&healthSignals, bool updateFromModule=false)=0
 Get the pointer to the health signal for this node. More...
 
virtual dwStatus getInputChannel (const uint8_t portID, ChannelObject *&channel) const =0
 Gets the input channel associated with the input port. More...
 
virtual dwStatus getInputPort (const uint8_t portID, dw::framework::PortBase *&port) const =0
 Gets the input port associated with the port id. More...
 
virtual dwStatus getName (const char **name)=0
 Get the name of the node. More...
 
virtual dwStatus getOutputChannel (const uint8_t portID, ChannelObject *&channel) const =0
 Gets the output channel associated with the output port. More...
 
virtual dwStatus getOutputPort (const uint8_t portID, dw::framework::PortBase *&port) const =0
 Gets the output port associated with the port id. More...
 
virtual dwStatus getPass (Pass **pass, uint8_t index)=0
 Get a const pointer to the pass at a specific index. 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)=0
 Get node passes filtered by processor type and process type. More...
 
virtual dwStatus reset ()=0
 Resets the state of the node. More...
 
virtual void resetPorts ()=0
 Resets all the ports in 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 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 setNodePeriod (uint32_t period)=0
 Set the node's period. More...
 
virtual dwStatus setOutputChannel (ChannelObject *channel, uint8_t portID)=0
 Sets an output channel for this node with an accompanying port. More...
 
virtual dwStatus setState (const char *state)=0
 Set the current state in node. Node implementation of this API need to be thread-safe. More...
 
virtual dwStatus updateCurrentErrorSignal (dwGraphErrorSignal &signal)=0
 A function that allows user override to update error signal It is automatically called by dwFramework when getErrorSignal is called and when pass returns non-success return code. More...
 
virtual dwStatus updateCurrentHealthSignal (dwGraphHealthSignal &signal)=0
 A function that allows user override to update health signal It is automatically called by dwFramework during teardown and when pass returns non-success return code. More...
 
virtual dwStatus validate ()=0
 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. More...
 
virtual ~Node ()=default
 

Static Public Attributes

static constexpr const size_t MAX_NAME_LEN {128U}
 
static constexpr const uint32_t MAX_PASS_COUNT {256U}
 
static constexpr const uint32_t MAX_PORT_COUNT {256U}
 

Member Typedef Documentation

◆ Name_t

Definition at line 73 of file Node.hpp.

Constructor & Destructor Documentation

◆ ~Node()

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

Member Function Documentation

◆ clearErrorSignal()

virtual dwStatus dw::framework::Node::clearErrorSignal ( )
pure virtual

Clear the error signal for this node.

Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ clearHealthSignal()

virtual dwStatus dw::framework::Node::clearHealthSignal ( )
pure virtual

Clear the health signal for this node.

Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getErrorSignal()

virtual dwStatus dw::framework::Node::getErrorSignal ( dwGraphErrorSignal sehErrorSignal,
dwGraphErrorSignal *&  errorSignal,
uint16_t const  sourceId,
char8_t const *  instanceName = nullptr 
)
pure virtual

Get the pointer to the error signal for this node.

Parameters
[out]sehErrorSignalError signal translated to SEH error codes given the instanceName.
[out]errorSignalThe error signal.
[in]sourceIdThe source id for the runnable this node is in.
[in]instanceNameInstance name for this instance of the node.
Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getHealthSignal()

virtual dwStatus dw::framework::Node::getHealthSignal ( dwGraphHealthSignal *&  healthSignals,
bool  updateFromModule = false 
)
pure virtual

Get the pointer to the health signal for this node.

Parameters
[out]healthSignalsThe health signal.
[in]updateFromModulefetch from module if set to true
Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getInputChannel()

virtual dwStatus dw::framework::Node::getInputChannel ( const uint8_t  portID,
ChannelObject *&  channel 
) const
pure virtual

Gets the input channel associated with the input port.

Parameters
[in]portIDThe port to get the channel from.
[out]channelThe channel associated to the portID.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getInputPort()

virtual dwStatus dw::framework::Node::getInputPort ( const uint8_t  portID,
dw::framework::PortBase *&  port 
) const
pure virtual

Gets the input port associated with the port id.

Parameters
[in]portIDThe port id associated with the input port.
[out]portThe port associated with the port id.
Returns
DW_SUCCESS
Exceptions
Exceptionif the node doesn't have an input port with the port id.

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getName()

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

Get the name of the node.

Parameters
nameThe output name.
Returns
DW_SUCCESS, DW_INVALID_ARUGMENT

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getOutputChannel()

virtual dwStatus dw::framework::Node::getOutputChannel ( const uint8_t  portID,
ChannelObject *&  channel 
) const
pure virtual

Gets the output channel associated with the output port.

Parameters
[in]portIDThe port to get the channel from.
[out]channelThe channel associated to the portID.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getOutputPort()

virtual dwStatus dw::framework::Node::getOutputPort ( const uint8_t  portID,
dw::framework::PortBase *&  port 
) const
pure virtual

Gets the output port associated with the port id.

Parameters
[in]portIDThe port id associated with the output port.
[out]portThe port associated with the port id.
Returns
DW_SUCCESS
Exceptions
Exceptionif the node doesn't have an output port with the port id.

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getPass()

virtual dwStatus dw::framework::Node::getPass ( Pass **  pass,
uint8_t  index 
)
pure virtual

Get a const pointer to the pass at a specific index.

Parameters
[out]passA const pointer to the pass
[in]indexThe index of the pass to get
Returns
DW_SUCCESS on success DW_NOT_INITIALIZED if setup and teardown pass does not exist DW_INVALID_ARGUMENT on invalid index

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getPassCount()

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

Get number of passes in the node.

Returns
The number of passes

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getPasses() [1/2]

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

Get all the passes in the node.

Parameters
passListThe output list to populate.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ getPasses() [2/2]

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

Get node passes filtered by processor type and process type.

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

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ reset()

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

Resets the state of the node.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeProcessNode, dw::framework::SimpleNode, and dw::framework::SimpleNodeT< T >.

◆ resetPorts()

virtual void dw::framework::Node::resetPorts ( )
pure virtual

Resets all the ports in the node.

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ run()

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

Runs all the passes in the node.

Returns
DW_SUCCESS, DW_FAILURE

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ runPass()

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

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::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ setInputChannel() [1/2]

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

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::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ setInputChannel() [2/2]

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

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::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setIterationCount()

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

Sets the node's iteration count.

Parameters
iterationCountThe current iteration count
Returns
DW_SUCCESS

Implemented in dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setName()

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

Set the name of the node.

Parameters
nameThe name of the node.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setNodePeriod()

virtual dwStatus dw::framework::Node::setNodePeriod ( uint32_t  period)
pure virtual

Set the node's period.

Parameters
periodNode's execution period in microseconds
Returns
DW_SUCCESS

Implemented in dw::framework::SimpleNode, and dw::framework::ExceptionSafeProcessNode.

◆ setOutputChannel()

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

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::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ setState()

virtual dwStatus dw::framework::Node::setState ( const char *  state)
pure virtual

Set the current state in node. Node implementation of this API need to be thread-safe.

Parameters
stateThe name of the new state which is about to start. The pointer is valid only for the runtime of the function and data should be stored with a deep copy.
Returns
DW_SUCCESS, DW_INVALID_ARGUMENT

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ updateCurrentErrorSignal()

virtual dwStatus dw::framework::Node::updateCurrentErrorSignal ( dwGraphErrorSignal signal)
pure virtual

A function that allows user override to update error signal It is automatically called by dwFramework when getErrorSignal is called and when pass returns non-success return code.

Parameters
[in,out]signalthat the node owner modifies to store current health. It is pre-filled with the latest module health signal
Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ updateCurrentHealthSignal()

virtual dwStatus dw::framework::Node::updateCurrentHealthSignal ( dwGraphHealthSignal signal)
pure virtual

A function that allows user override to update health signal It is automatically called by dwFramework during teardown and when pass returns non-success return code.

Parameters
[in,out]signalthat the node owner modifies to store current health. It is pre-filled with the latest module health signal
Returns
DW_SUCCESS

Implemented in dw::framework::ExceptionSafeProcessNode, and dw::framework::SimpleNode.

◆ validate()

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

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::ExceptionSafeProcessNode, dw::framework::SimpleNode, and dw::framework::SimpleNodeT< T >.

Member Data Documentation

◆ MAX_NAME_LEN

constexpr const size_t dw::framework::Node::MAX_NAME_LEN {128U}
staticconstexpr

Definition at line 71 of file Node.hpp.

◆ MAX_PASS_COUNT

constexpr const uint32_t dw::framework::Node::MAX_PASS_COUNT {256U}
staticconstexpr

Definition at line 81 of file Node.hpp.

◆ MAX_PORT_COUNT

constexpr const uint32_t dw::framework::Node::MAX_PORT_COUNT {256U}
staticconstexpr

Definition at line 77 of file Node.hpp.


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