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/base/ObjectExtra.h> 39 #include <dwcgf/Types.hpp> 44 #include <dw/core/container/VectorFixed.hpp> 45 #include <dw/core/container/BaseString.hpp> 55 using dw::core::FixedString;
56 using dw::core::VectorFixed;
57 class ParameterProvider;
59 #define _DW_CGF_STRINGIFY(x) #x 61 #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) 67 using Name_t = FixedString<MAX_NAME_LEN>;
72 static constexpr uint8_t
PASS_SETUP = std::numeric_limits<uint8_t>::max() - 1;
73 static constexpr uint8_t
PASS_TEARDOWN = std::numeric_limits<uint8_t>::max();
75 virtual ~Node() =
default;
81 virtual dwStatus
reset() = 0;
123 virtual dwStatus
run() = 0;
150 virtual dwStatus
getPasses(VectorFixed<
Pass*>& passList) = 0;
160 dwProcessorType processorType,
161 dwProcessType processType) = 0;
168 virtual dwStatus
setName(const
char* name) = 0;
175 virtual dwStatus
getName(const
char** name) = 0;
207 virtual dwStatus start() = 0;
213 virtual dwStatus stop() = 0;
219 virtual dwStatus setAffinityMask(uint) = 0;
225 virtual dwStatus setThreadPriority(
int) = 0;
231 virtual dwStatus setStartTime(dwTime_t) = 0;
237 virtual dwStatus setEndTime(dwTime_t) = 0;
243 virtual dwStatus isVirtual(
bool* isVirtualBool) = 0;
309 virtual dwStatus preShutdown() = 0;
322 virtual dwStatus setAsyncReset() = 0;
327 virtual dwStatus executeAsyncReset() = 0;
338 #endif //DW_FRAMEWORK_BASECLASS_NODE_HPP_ static constexpr uint8_t PASS_TEARDOWN
dw::core::Function< void(DataEvent)> DataEventWriteCallback
virtual dwStatus validate()=0
Checks that all mandatory ports are bound.
virtual dwStatus reset()=0
Resets the state of the node.
DataEventType dataEventType
The type of event.
static constexpr uint32_t MAX_PORT_COUNT
static constexpr uint8_t PASS_SETUP
virtual dwStatus run()=0
Runs all the passes in the node.
virtual dwStatus runPassByID(uint8_t passID)=0
Run one pass by ID as defined by the PassList enum class.
FixedString< MAX_NAME_LEN > Name_t
dwStatus status
The status of the node-run.
Record of data sensor data frame.
Pass is a runnable describes the metadata of a pass.
static constexpr uint32_t MAX_PASS_COUNT
static constexpr size_t MAX_NAME_LEN
For nodes require extra actions to be taken before shutdown should implement this interface...
virtual dwStatus setIterationCount(uint32_t iterationCount)=0
Sets the node's iteration count.
virtual dwStatus getHealthSignals(dwGraphHealthSignalArray *&healthSignals)=0
Get the pointer to the health signal array for this node.
virtual dwStatus runPass(size_t passIndex)=0
Run one pass by index as defined by the pass descriptors.
virtual size_t getPassCount() const noexcept=0
Get number of passes in the node.
dw::core::Function< bool(DataEvent &)> DataEventReadCallback
constexpr size_t passIndex(dw::core::StringView identifier)
Get the the pass index for a pass identified by name.
virtual dwStatus setOutputChannel(ChannelObject *channel, uint8_t portID)=0
Sets an output channel for this node with an accompanying port.
virtual dwStatus setInputChannel(ChannelObject *channel, uint8_t portID)=0
Sets an input channel for this node with an accompanying port.
virtual dwStatus getName(const char **name)=0
Get the name of the node.
dwTime_t timestamp
The timestamp of involved data.
virtual dwStatus getPasses(VectorFixed< Pass *> &passList)=0
Get all the passes in the node.
virtual dwStatus setName(const char *name)=0
Set the name of the node.