31#ifndef DW_FRAMEWORK_BASECLASS_NODE_HPP_
32#define DW_FRAMEWORK_BASECLASS_NODE_HPP_
36#include <dw/core/base/Types.h>
37#include <dw/core/context/ObjectExtra.h>
41#include <dwshared/dwfoundation/dw/core/logger/Logger.hpp>
43#include <dwshared/dwfoundation/dw/core/container/VectorFixed.hpp>
44#include <dwshared/dwfoundation/dw/core/container/BaseString.hpp>
55using dw::core::FixedString;
56using dw::core::VectorFixed;
58class ParameterProvider;
60#define DW_CGF_STRINGIFY(x) #x
62#define STRING_VIEW_OF_FIXED_STRING_TEMPLATE_TYPE(x) dw::core::StringView("dw::core::FixedString<" DW_CGF_STRINGIFY(x) ">", sizeof("dw::core::FixedString<" DW_CGF_STRINGIFY(x) ">") - 1)
112 virtual dwStatus
run() = 0;
150 virtual dwStatus
setName(const
char* name) = 0;
157 virtual dwStatus
getName(const
char** name) = 0;
Basic error signal that gets reported only when there is an error.
Basic health signal that describes the health status of the graph.
virtual ~IChannelsConnectedListener()=default
virtual void onChannelsConnected()=0
Callback received after channels are connected.
virtual dwStatus preShutdown()=0
actions to be taken before node shutdown
virtual ~IContainsPreShutdownAction()=default
virtual dwStatus setAffinityMask(uint)=0
Sets the affinity mask of the sensor.
virtual dwStatus setLockstepDeterministicMode(bool enable)=0
Set whether replay is running in lockstep deterministic mode.
virtual dwStatus setDataEventReadCallback(DataEventReadCallback cb)=0
Set read timestamp function for dataset replay. Timestamps not in the sequence returned by the callba...
virtual dwStatus setDataEventWriteCallback(DataEventWriteCallback cb)=0
Set write timestamp function for live case. Each timestamp of data output from the node will be passe...
virtual dwStatus start()=0
Start the sensor.
virtual dwStatus setEndTime(dwTime_t)=0
Set end timestamp for dataset replay.
dw::core::Function< bool(DataEvent &)> DataEventReadCallback
virtual dwStatus isEnabled(bool &isEnabled)=0
Whether or not the node is enabled.
virtual dwStatus stop()=0
Stop the sensor.
virtual dwStatus isVirtual(bool *isVirtualBool)=0
distinguishes between a live and virtual sensor
DataEventType dataEventType
virtual dwStatus getNextTimestamp(dwTime_t &nextTimestamp)=0
Get the next timestamp of the sensor.
dw::core::Function< void(DataEvent)> DataEventWriteCallback
virtual dwStatus setThreadPriority(int)=0
Sets the thread priority of the sensor.
virtual dwStatus setStartTime(dwTime_t)=0
Set start timestamp for dataset replay.
virtual dwStatus getModuleHealthSignal(dwHealthSignal &healthSignal)=0
Return a copy of health signals from module that is a member of node.
virtual dwStatus validate()=0
Checks that all mandatory ports are bound. The implementation should validate that all the ports are ...
virtual dwStatus setNodePeriod(uint32_t period)=0
Set the node's period.
virtual dwStatus addToErrorSignal(uint32_t error, dwTime_t timestamp=0L)=0
A function the allows user to add an error to the error signal list.
virtual dwStatus collectHealthSignals(dwGraphHealthSignal *&healthSignal)=0
Collect health signals from node and module, combine and return the pointer to the health signal for ...
virtual dwStatus runPass(size_t passIndex)=0
Run one pass by index as defined by the pass descriptors.
virtual dwStatus getOutputChannel(const size_t portID, ChannelObject *&channel) const =0
Gets the output channel associated with the output port.
virtual dwStatus run()=0
Runs all the passes in the node.
virtual size_t getPassCount() const noexcept=0
Get number of passes in the node.
virtual dwStatus setIterationCount(uint32_t iterationCount)=0
Sets the node's iteration count.
virtual dwStatus getNodeErrorSignal(dwGraphErrorSignal &errorSignal)=0
Get a copy of the error signals for the node.
virtual dwStatus getOutputPort(const size_t portID, dw::framework::PortBase *&port) const =0
Gets the output port associated with the port id.
virtual dwStatus getModuleErrorSignal(dwErrorSignal &errorSignal)=0
Get a copy of the error signals from the module that is a member of this node.
virtual dwStatus updateCurrentHealthSignal(dwGraphHealthSignal &signal)=0
A function that allows user override to update health signal It is automatically called by dwFramewor...
virtual void resetPorts()=0
Resets all the ports in the node.
virtual dwStatus addToHealthSignal(uint32_t error, dwTime_t timestamp=0L)=0
A function the allows user to add an error to the health signal list.
virtual dwStatus getPasses(VectorFixed< Pass * > &passList)=0
Get all the passes in the node.
virtual dwStatus setOutputChannel(ChannelObject *channel, size_t portID)=0
Sets an output channel for this node with an accompanying port.
virtual dwStatus setName(const char *name)=0
Set the name of the node.
virtual dwStatus getNodeHealthSignal(dwGraphHealthSignal &healthSignal)=0
Return a copy of graph health signals for the node.
virtual dwStatus getInputChannel(const size_t portID, ChannelObject *&channel) const =0
Gets the input channel associated with the input port.
virtual dwStatus getInputPort(const size_t portID, dw::framework::PortBase *&port) const =0
Gets the input port associated with the port id.
virtual dwStatus getName(const char **name)=0
Get the name of the node.
static constexpr const size_t MAX_NAME_LEN
virtual dwStatus updateCurrentErrorSignal(dwGraphErrorSignal &signal)=0
A function that allows user override to update error signal It is automatically called by dwFramework...
virtual dwStatus clearHealthSignal()=0
Clear the health signal for this node.
virtual dwStatus setInputChannel(ChannelObject *channel, size_t portID)=0
Sets an input channel for this node with an accompanying port.
virtual dwStatus getPass(Pass *&pass, size_t index)=0
Get a const pointer to the pass at a specific index.
virtual dwStatus clearErrorSignal()=0
Clear the error signal for this node.
virtual dwStatus reset()=0
Resets the state of the node.
virtual dwStatus setState(const char *state)=0
Set the current state in node. Node implementation of this API need to be thread-safe.
virtual dwStatus collectErrorSignals(dwGraphErrorSignal *&errorSignal)=0
Collect error signals from node and module, combine and return the pointer to the error signal for th...
Pass is a runnable describes the metadata of a pass.
constexpr size_t passIndex(dw::core::StringView identifier)
Get the the pass index for a pass identified by name.