Compute Graph Framework SDK Reference  5.8
SimpleNode.hpp
Go to the documentation of this file.
1
2//
3// Notice
4// ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5// NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6// THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7// MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8//
9// NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10// information or for any infringement of patents or other rights of third parties that may
11// result from its use. No license is granted by implication or otherwise under any patent
12// or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13// expressly authorized by NVIDIA. Details are subject to change without notice.
14// This code supersedes and replaces all information previously supplied.
15// NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16// components in life support devices or systems without express written approval of
17// NVIDIA CORPORATION & AFFILIATES.
18//
19// SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21//
22// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23// property and proprietary rights in and to this material, related
24// documentation and any modifications thereto. Any use, reproduction,
25// disclosure or distribution of this material and related documentation
26// without an express license agreement from NVIDIA CORPORATION or
27// its affiliates is strictly prohibited.
28//
30
31#ifndef DW_FRAMEWORK_SIMPLENODE_HPP_
32#define DW_FRAMEWORK_SIMPLENODE_HPP_
33
34#include <dw/core/base/Types.h>
35#include <dwcgf/Exception.hpp>
36#include <dwcgf/Types.hpp>
38#include <dwcgf/pass/Pass.hpp>
39#include <dwcgf/node/Node.hpp>
45
46#include <dw/core/container/VectorFixed.hpp>
47#include <dw/core/container/BaseString.hpp>
48
49#include <functional>
50#include <map>
51
52namespace dw
53{
54namespace framework
55{
56
58{
62};
63
64template <typename NodeT>
66{
68 params.maxInputPortCount = portSize<NodeT, PortDirection::INPUT>();
69 params.maxOutputPortCount = portSize<NodeT, PortDirection::OUTPUT>();
70 params.maxPassCount = passSize<NodeT>();
71 return params;
72}
73
74class SimpleNode : public Node
75{
76public:
77 static constexpr const char* PASS_SETUP_NAME = "SETUP";
78 static constexpr const char* PASS_TEARDOWN_NAME = "TEARDOWN";
79
83 virtual ~SimpleNode();
84
85 dwStatus reset() override
86 {
87 throw Exception(DW_NOT_IMPLEMENTED, "SimpleNode::reset() not implemented");
88 }
89
91
94 dwStatus setInputChannel(ChannelObject* channel, uint8_t portID) override;
95
96 dwStatus setInputChannel(ChannelObject*, uint8_t, dwSerializationType) override
97 {
98 throw Exception(DW_NOT_IMPLEMENTED, "SimpleNode::setInputChannel() not implemented");
99 }
100
102
105 dwStatus setOutputChannel(ChannelObject* channel, uint8_t portID) override;
106
107 dwStatus validate() override
108 {
109 throw Exception(DW_NOT_IMPLEMENTED, "SimpleNode::validate() not implemented");
110 }
111
113
116 dwStatus validate(const char* direction, const PortCollectionDescriptor& collection, const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>>& ports, size_t indexOffset = 0);
117
118 dwStatus run() override;
119 size_t getPassCount() const noexcept override;
120 dwStatus runPassByID(uint8_t passID) override;
121 dwStatus runPass(size_t passIndex) override;
122 dwStatus getPasses(VectorFixed<Pass*>& passList) override;
123 dwStatus getPasses(VectorFixed<Pass*>& passList, dwProcessorType processorType, dwProcessType processType) override;
124
125 dwStatus setName(const char* name) final;
126 dwStatus getName(const char** name) override;
127
128 dwStatus getErrorSignal(dwGraphErrorSignal*& errorSignal) override;
129 dwStatus getHealthSignal(dwGraphHealthSignal*& healthSignals, bool updateFromModule = false) override;
130
131 template <typename Func, typename PortList>
132 void iteratePorts(PortList& portList, Func func)
133 {
134 for (auto elem : portList)
135 {
136 func(elem);
137 }
138 }
139
140 template <typename Func>
142 {
143 iteratePorts(m_inputPorts, [&func, this](decltype(m_inputPorts)::TElement& elem) {
144 if (auto managedPort = dynamic_cast<ManagedPortInputBase*>(elem.second.get()))
145 {
146 func(*managedPort);
147 }
148 else
149 {
150 const char* nodeName = nullptr;
151 this->getName(&nodeName);
152 throw Exception(DW_BAD_CAST, "SimpleNode: ports are wrong class, node ", nodeName);
153 }
154 });
155 }
156
157 template <typename Func>
159 {
160 iteratePorts(m_outputPorts, [&func, this](decltype(m_outputPorts)::TElement& elem) {
161 if (auto managedPort = dynamic_cast<ManagedPortOutputBase*>(elem.second.get()))
162 {
163 func(*managedPort);
164 }
165 else
166 {
167 const char* nodeName = nullptr;
168 this->getName(&nodeName);
169 throw Exception(DW_BAD_CAST, "SimpleNode: ports are wrong class node ", nodeName);
170 }
171 });
172 }
173
174 template <typename ModuleHandle_t>
175 dwStatus setModuleHandle(ModuleHandle_t handle, dwContextHandle_t context)
176 {
177 dwModuleHandle_t moduleHandle;
178
179 if (DW_NULL_HANDLE == handle)
180 {
181 return DW_INVALID_ARGUMENT;
182 }
183
184 dwStatus ret = getModuleHandle(&moduleHandle, handle, context);
185 if (DW_SUCCESS != ret)
186 {
187 return ret;
188 }
189
190 return setObjectHandle(moduleHandle);
191 }
192
193 virtual dwStatus setObjectHandle(dwModuleHandle_t handle);
194
195protected:
196 dwStatus getModuleHandle(dwModuleHandle_t* moduleHandle, void* handle, dwContextHandle_t context);
197
198 virtual std::unique_ptr<Pass> createSetupPass()
199 {
200 throw Exception(DW_NOT_IMPLEMENTED, "SimpleNode::createSetupPass() not implemented");
201 }
202
203 virtual std::unique_ptr<Pass> createTeardownPass()
204 {
205 throw Exception(DW_NOT_IMPLEMENTED, "SimpleNode::createTeardownPass() not implemented");
206 }
207
230 template <typename PassFunctionT, typename... Args>
231 std::unique_ptr<PassImpl<PassFunctionT>> make_pass(PassFunctionT func, Args&&... args)
232 {
233 return std::make_unique<PassImpl<PassFunctionT>>(*this, func, std::forward<Args>(args)...);
234 }
235
237
243 template <
244 typename NodeT, size_t PassIndex, typename PassFunctionT>
245 void registerPass(PassFunctionT func, NvMediaDla* dlaEngine = nullptr)
246 {
247 if (!isValidPass<NodeT>(PassIndex))
248 {
249 throw Exception(DW_INVALID_ARGUMENT, "registerPass called with an invalid pass id: ", PassIndex);
250 }
251 if (m_passList.size() == 0 || m_passList.size() - 1 < PassIndex)
252 {
253 m_passList.resize(PassIndex + 1);
254 m_passOwnershipList.resize(PassIndex + 1);
255 }
256 if (m_passList[PassIndex] != nullptr)
257 {
258 throw Exception(DW_INVALID_ARGUMENT, "registerPass called with a pass id which has been added before: ", PassIndex);
259 }
260 dwProcessorType processorType = passProcessorType<NodeT, PassIndex>();
261 dwProcessType processType = determineProcessType(processorType);
262 if (dlaEngine == nullptr)
263 {
264 m_passList[PassIndex] = std::make_unique<PassImpl<PassFunctionT>>(*this, func, processorType, processType, -1, -1, -1);
265 }
266 else if (processorType == DW_PROCESSOR_TYPE_DLA_0)
267 {
268 m_passList[PassIndex] = std::make_unique<PassImpl<PassFunctionT>>(*this, func, processorType, processType, -1, -1, -1, dlaEngine);
269 }
270 else
271 {
272 throw Exception(DW_INVALID_ARGUMENT, "registerPass called with a pass which has dlaEngine but not a DLA pass: ", PassIndex);
273 }
274 m_passOwnershipList[PassIndex] = true;
275 }
276
277public:
280 void addPass(Pass* pass);
281
287
294
302 dwStatus copyModuleHealthSignals(dwHealthSignal& outSignal);
303
313
323
324private:
325 inline dwProcessType determineProcessType(dwProcessorType processorType)
326 {
327 if (processorType == DW_PROCESSOR_TYPE_GPU ||
328 processorType == DW_PROCESSOR_TYPE_DLA_0)
329 {
330 return DW_PROCESS_TYPE_ASYNC;
331 }
332 return DW_PROCESS_TYPE_SYNC;
333 }
334
335 dwStatus updateHealthSignalFromModule();
336
337 VectorFixed<std::unique_ptr<Pass>> m_passList;
338 // tracking ownership is only necessary until addPass(..., Pass* pass) is removed
339 VectorFixed<bool> m_passOwnershipList;
340 FixedString<MAX_NAME_LEN> m_name{};
341 bool m_setupTeardownCreated = false;
342
344 dwGraphErrorSignal m_errorSignal{};
345 dwGraphHealthSignal m_healthSignal{};
346
347 dwModuleHandle_t m_object{};
348 uint32_t m_iterationCount{};
349
350public:
352 template <typename TPort, typename... Args>
353 std::unique_ptr<TPort> make_port(Args&&... args)
354 {
355 auto port = std::make_unique<TPort>(std::forward<Args>(args)...);
356 port->setSyncRetriever(std::bind(&SimpleNode::getIterationCount, this));
357 return port;
358 }
359
361
364 template <typename NodeT, size_t PortIndex, typename... Args>
365 void initInputPort(Args&&... args)
366 {
367 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
368 auto port = std::make_shared<ManagedPortInput<DataType>>(std::forward<Args>(args)...);
369 if (m_inputPorts.find(PortIndex) != m_inputPorts.end())
370 {
371 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id registered multiple times: ", PortIndex);
372 }
373 m_inputPorts[PortIndex] = port;
374 }
375
377
380 template <typename NodeT, size_t PortIndex, typename... Args>
381 void initInputArrayPort(Args&&... args)
382 {
383 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
384 constexpr size_t descriptor_index = descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>();
385 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::INPUT, descriptor_index>();
386 for (size_t i = 0; i < arraySize; ++i)
387 {
388 auto port = std::make_shared<ManagedPortInput<DataType>>(std::forward<Args>(args)...);
389 if (m_inputPorts.find(PortIndex + i) != m_inputPorts.end())
390 {
391 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id registered multiple times: ", PortIndex + i);
392 }
393 m_inputPorts[PortIndex + i] = port;
394 }
395 }
396
398
401 template <typename NodeT, size_t PortIndex, typename... Args>
402 void initOutputPort(Args&&... args)
403 {
404 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
405 auto port = std::make_shared<ManagedPortOutput<DataType>>(std::forward<Args>(args)...);
406 if (m_outputPorts.find(PortIndex) != m_outputPorts.end())
407 {
408 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id registered multiple times: ", PortIndex);
409 }
410 m_outputPorts[PortIndex] = port;
411 }
412
414
417 template <typename NodeT, size_t PortIndex, typename... Args>
418 void initOutputArrayPort(Args&&... args)
419 {
420 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
421 constexpr size_t descriptor_index = descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>();
422 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::OUTPUT, descriptor_index>();
423 for (size_t i = 0; i < arraySize; ++i)
424 {
425 auto port = std::make_shared<ManagedPortOutput<DataType>>(std::forward<Args>(args)...);
426 if (m_outputPorts.find(PortIndex + i) != m_outputPorts.end())
427 {
428 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id registered multiple times: ", PortIndex + i);
429 }
430 m_outputPorts[PortIndex + i] = port;
431 }
432 }
433
435 template <typename NodeT, size_t PortIndex>
437 {
438 constexpr bool isArray = descriptorPortArray<
439 NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
440 static_assert(!isArray, "Input port is an array, must pass an array index");
441 if (m_inputPorts.find(PortIndex) == m_inputPorts.end())
442 {
443 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id not registered: ", PortIndex);
444 }
445 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
446 using PointerType = ManagedPortInput<DataType>;
447 using ReturnType = std::shared_ptr<PointerType>;
448 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_inputPorts[PortIndex]);
449 if (!port)
450 {
451 throw Exception(DW_BAD_CAST, "Failed to cast the following input port to its declared type: ", PortIndex);
452 }
453 return *port;
454 }
455
457 template <typename NodeT, size_t PortIndex>
459 {
460 constexpr bool isArray = descriptorPortArray<NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
461 static_assert(isArray, "Input port is not an array, must not pass an array index");
462 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
463 if (arrayIndex >= arraySize)
464 {
465 throw Exception(DW_INVALID_ARGUMENT, "The array index is out of bound: ", arrayIndex);
466 }
467 if (m_inputPorts.find(PortIndex + arrayIndex) == m_inputPorts.end())
468 {
469 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id not registered: ", PortIndex + arrayIndex);
470 }
471 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
472 using PointerType = ManagedPortInput<DataType>;
473 using ReturnType = std::shared_ptr<PointerType>;
474 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_inputPorts[PortIndex + arrayIndex]);
475 if (!port)
476 {
477 throw Exception(DW_BAD_CAST, "Failed to cast the following input port to its declared type: ", PortIndex + arrayIndex);
478 }
479 return *port;
480 }
481
483 template <typename NodeT, size_t PortIndex>
485 {
486 constexpr bool isArray = descriptorPortArray<
487 NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
488 static_assert(!isArray, "Output port is an array, must pass an array index");
489 if (m_outputPorts.find(PortIndex) == m_outputPorts.end())
490 {
491 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id not registered: ", PortIndex);
492 }
493 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
494 using PointerType = ManagedPortOutput<DataType>;
495 using ReturnType = std::shared_ptr<PointerType>;
496 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_outputPorts[PortIndex]);
497 if (!port)
498 {
499 throw Exception(DW_BAD_CAST, "Failed to cast the following output port to its declared type: ", PortIndex);
500 }
501 return *port;
502 }
503
505 template <typename NodeT, size_t PortIndex>
507 {
508 constexpr bool isArray = descriptorPortArray<NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
509 static_assert(isArray, "Output port is not an array, must not pass an array index");
510 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
511 if (arrayIndex >= arraySize)
512 {
513 throw Exception(DW_INVALID_ARGUMENT, "The array index is out of bound: ", arrayIndex);
514 }
515 if (m_outputPorts.find(PortIndex + arrayIndex) == m_outputPorts.end())
516 {
517 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id not registered: ", PortIndex + arrayIndex);
518 }
519 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
520 using PointerType = ManagedPortOutput<DataType>;
521 using ReturnType = std::shared_ptr<PointerType>;
522 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_outputPorts[PortIndex + arrayIndex]);
523 if (!port)
524 {
525 throw Exception(DW_BAD_CAST, "Failed to cast the following output port to its declared type: ", PortIndex + arrayIndex);
526 }
527 return *port;
528 }
529
531
535 dwStatus setup();
536
538
542 dwStatus teardown();
543
545
549 void resetPorts() override;
550
555 dwStatus setIterationCount(uint32_t iterationCount) override;
556
557 const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>>& getRegisteredInputPorts() const
558 {
559 return m_inputPorts;
560 }
561
562 const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>>& getRegisteredOutputPorts() const
563 {
564 return m_outputPorts;
565 }
566
567 uint32_t getIterationCount() const;
568
573 dwStatus setState(const char* state) override
574 {
575 static_cast<void>(state);
576 return DW_SUCCESS;
577 }
578
579protected:
580 dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>> m_inputPorts;
581 dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>> m_outputPorts;
582
583 std::atomic<bool> m_asyncResetFlag{false};
584};
585
587{
588public:
589 static constexpr char LOG_TAG[] = "SimpleSensorNode";
590
591 dwStatus start() override
592 {
593 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::start() not implemented");
594 }
595
596 dwStatus stop() override
597 {
598 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::stop() not implemented");
599 }
600
601 dwStatus isVirtual(bool*) override
602 {
603 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::isVirtual() not implemented");
604 }
605
607 {
608 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::setDataEventReadCallback() not implemented");
609 }
610
612 {
613 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::setDataEventWriteCallback() not implemented");
614 }
615};
616
619{
620public:
623};
624
625} // namespace framework
626} // namespace dw
627
628#endif // DW_FRAMEWORK_SIMPLENODE_HPP_
Basic error signal that gets reported only when there is an error.
Basic health signal that describes the health status of the graph.
dw::core::Function< bool(DataEvent &)> DataEventReadCallback
Definition: Node.hpp:310
dw::core::Function< void(DataEvent)> DataEventWriteCallback
Definition: Node.hpp:319
static constexpr uint32_t MAX_PORT_COUNT
Definition: Node.hpp:69
static constexpr uint32_t MAX_PASS_COUNT
Definition: Node.hpp:71
Pass is a runnable describes the metadata of a pass.
Definition: Pass.hpp:49
ManagedPortOutput< decltype(portType< NodeT, PortDirection::OUTPUT, PortIndex >())> & getOutputPort(size_t arrayIndex)
Get one specific ManagedPortOutput from a previously initialized output array port.
Definition: SimpleNode.hpp:506
dwStatus reset() override
Definition: SimpleNode.hpp:85
void iterateManagedInputPorts(Func func)
Definition: SimpleNode.hpp:141
dwStatus validate(const char *direction, const PortCollectionDescriptor &collection, const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > &ports, size_t indexOffset=0)
Helper function used by dw::framework::SimpleNodeT::validate.
dwStatus validate() override
Definition: SimpleNode.hpp:107
dwStatus getErrorSignal(dwGraphErrorSignal *&errorSignal) override
static constexpr const char * PASS_TEARDOWN_NAME
Definition: SimpleNode.hpp:78
dwStatus setInputChannel(ChannelObject *, uint8_t, dwSerializationType) override
Definition: SimpleNode.hpp:96
void initInputPort(Args &&... args)
Initialize a ManagedPortInput which will be owned by the base class and can be retrieved using getInp...
Definition: SimpleNode.hpp:365
dwStatus updateHealthSignal(const dwGraphHealthSignal &signal)
Adds the provided Health Signal to the Health Signal Array. If the array is full, the new signal will...
dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > m_inputPorts
Definition: SimpleNode.hpp:580
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > & getRegisteredInputPorts() const
Definition: SimpleNode.hpp:557
dwStatus copyModuleHealthSignals(dwHealthSignal &outSignal)
Copy health signals from the module over to the node and stores in outSignal.
void initInputArrayPort(Args &&... args)
Initialize an array of ManagedPortInput which will be owned by the base class and can be retrieved us...
Definition: SimpleNode.hpp:381
void registerPass(PassFunctionT func, NvMediaDla *dlaEngine=nullptr)
Register a pass function with the node base class.
Definition: SimpleNode.hpp:245
SimpleNode(NodeAllocationParams params)
Constructor which tailors the preallocated size of the internal collections for ports and passes to t...
dwStatus setInputChannel(ChannelObject *channel, uint8_t portID) override
Associate an input port with a channel instances.
size_t getPassCount() const noexcept override
dwStatus setName(const char *name) final
uint32_t getIterationCount() const
dwStatus reportCurrentErrorSignal(dwGraphErrorSignal &signal) override
A function that allows user override to update error signal It is automatically called by dwFramework...
dwStatus setModuleHandle(ModuleHandle_t handle, dwContextHandle_t context)
Definition: SimpleNode.hpp:175
dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > m_outputPorts
Definition: SimpleNode.hpp:581
virtual std::unique_ptr< Pass > createTeardownPass()
Definition: SimpleNode.hpp:203
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > & getRegisteredOutputPorts() const
Definition: SimpleNode.hpp:562
void iterateManagedOutputPorts(Func func)
Definition: SimpleNode.hpp:158
void addPass(Pass *pass)
dwStatus run() override
void resetPorts() override
Default implementation to reset ports managed by the base class.
dwStatus setState(const char *state) override
Definition: SimpleNode.hpp:573
dwStatus getName(const char **name) override
virtual std::unique_ptr< Pass > createSetupPass()
Definition: SimpleNode.hpp:198
dwStatus runPass(size_t passIndex) override
std::unique_ptr< TPort > make_port(Args &&... args)
Definition: SimpleNode.hpp:353
std::unique_ptr< PassImpl< PassFunctionT > > make_pass(PassFunctionT func, Args &&... args)
Definition: SimpleNode.hpp:231
dwStatus getHealthSignal(dwGraphHealthSignal *&healthSignals, bool updateFromModule=false) override
dwStatus reportCurrentHealthSignal(dwGraphHealthSignal &signal) override
A function that allows user override to update health signal It is automatically called by dwFramewor...
dwStatus clearHealthSignal()
Clears the current Health Signals from the Health Signal Array.
dwStatus getPasses(VectorFixed< Pass * > &passList) override
dwStatus getModuleHandle(dwModuleHandle_t *moduleHandle, void *handle, dwContextHandle_t context)
dwStatus setup()
Default implementation of the setup pass.
ManagedPortInput< decltype(portType< NodeT, PortDirection::INPUT, PortIndex >())> & getInputPort()
Get a previously initialized non-array ManagedPortInput.
Definition: SimpleNode.hpp:436
void initOutputPort(Args &&... args)
Initialize a ManagedPortOutput which will be owned by the base class and can be retrieved using getOu...
Definition: SimpleNode.hpp:402
void iteratePorts(PortList &portList, Func func)
Definition: SimpleNode.hpp:132
dwStatus runPassByID(uint8_t passID) override
virtual dwStatus setObjectHandle(dwModuleHandle_t handle)
ManagedPortInput< decltype(portType< NodeT, PortDirection::INPUT, PortIndex >())> & getInputPort(size_t arrayIndex)
Get one specific ManagedPortInput from a previously initialized input array port.
Definition: SimpleNode.hpp:458
static constexpr const char * PASS_SETUP_NAME
Definition: SimpleNode.hpp:77
dwStatus teardown()
Default implementation of the teardown pass.
dwStatus setIterationCount(uint32_t iterationCount) override
dwStatus setOutputChannel(ChannelObject *channel, uint8_t portID) override
Associate an output port with a channel instances.
std::atomic< bool > m_asyncResetFlag
Definition: SimpleNode.hpp:583
void initOutputArrayPort(Args &&... args)
Initialize an array of ManagedPortOutput which will be owned by the base class and can be retrieved u...
Definition: SimpleNode.hpp:418
ManagedPortOutput< decltype(portType< NodeT, PortDirection::OUTPUT, PortIndex >())> & getOutputPort()
Get a previously initialized non-array ManagedPortOutput.
Definition: SimpleNode.hpp:484
SimpleProcessNode(NodeAllocationParams params)
dwStatus isVirtual(bool *) override
Definition: SimpleNode.hpp:601
dwStatus setDataEventWriteCallback(DataEventWriteCallback) override
Definition: SimpleNode.hpp:611
static constexpr char LOG_TAG[]
Definition: SimpleNode.hpp:589
dwStatus setDataEventReadCallback(DataEventReadCallback) override
Definition: SimpleNode.hpp:606
constexpr bool descriptorPortArray()
constexpr size_t passIndex(dw::core::StringView identifier)
Get the the pass index for a pass identified by name.
NodeAllocationParams createAllocationParams()
Definition: SimpleNode.hpp:65
Definition: Exception.hpp:47