Compute Graph Framework SDK Reference  5.6
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 uint16_t getInstanceIdFromName() const;
338
339 VectorFixed<std::unique_ptr<Pass>> m_passList;
340 // tracking ownership is only necessary until addPass(..., Pass* pass) is removed
341 VectorFixed<bool> m_passOwnershipList;
342 FixedString<MAX_NAME_LEN> m_name{};
343 bool m_setupTeardownCreated = false;
344
346 dwGraphErrorSignal m_errorSignal{};
347 dwGraphHealthSignal m_healthSignal{};
348
349 dwModuleHandle_t m_object{};
350 uint32_t m_iterationCount{};
351
352public:
354 template <typename TPort, typename... Args>
355 std::unique_ptr<TPort> make_port(Args&&... args)
356 {
357 auto port = std::make_unique<TPort>(std::forward<Args>(args)...);
358 port->setSyncRetriever(std::bind(&SimpleNode::getIterationCount, this));
359 return port;
360 }
361
363
366 template <typename NodeT, size_t PortIndex, typename... Args>
367 void initInputPort(Args&&... args)
368 {
369 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
370 auto port = std::make_shared<ManagedPortInput<DataType>>(std::forward<Args>(args)...);
371 if (m_inputPorts.find(PortIndex) != m_inputPorts.end())
372 {
373 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id registered multiple times: ", PortIndex);
374 }
375 m_inputPorts[PortIndex] = port;
376 }
377
379
382 template <typename NodeT, size_t PortIndex, typename... Args>
383 void initInputArrayPort(Args&&... args)
384 {
385 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
386 constexpr size_t descriptor_index = descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>();
387 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::INPUT, descriptor_index>();
388 for (size_t i = 0; i < arraySize; ++i)
389 {
390 auto port = std::make_shared<ManagedPortInput<DataType>>(std::forward<Args>(args)...);
391 if (m_inputPorts.find(PortIndex + i) != m_inputPorts.end())
392 {
393 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id registered multiple times: ", PortIndex + i);
394 }
395 m_inputPorts[PortIndex + i] = port;
396 }
397 }
398
400
403 template <typename NodeT, size_t PortIndex, typename... Args>
404 void initOutputPort(Args&&... args)
405 {
406 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
407 auto port = std::make_shared<ManagedPortOutput<DataType>>(std::forward<Args>(args)...);
408 if (m_outputPorts.find(PortIndex) != m_outputPorts.end())
409 {
410 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id registered multiple times: ", PortIndex);
411 }
412 m_outputPorts[PortIndex] = port;
413 }
414
416
419 template <typename NodeT, size_t PortIndex, typename... Args>
420 void initOutputArrayPort(Args&&... args)
421 {
422 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
423 constexpr size_t descriptor_index = descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>();
424 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::OUTPUT, descriptor_index>();
425 for (size_t i = 0; i < arraySize; ++i)
426 {
427 auto port = std::make_shared<ManagedPortOutput<DataType>>(std::forward<Args>(args)...);
428 if (m_outputPorts.find(PortIndex + i) != m_outputPorts.end())
429 {
430 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id registered multiple times: ", PortIndex + i);
431 }
432 m_outputPorts[PortIndex + i] = port;
433 }
434 }
435
437 template <typename NodeT, size_t PortIndex>
439 {
440 constexpr bool isArray = descriptorPortArray<
441 NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
442 static_assert(!isArray, "Input port is an array, must pass an array index");
443 if (m_inputPorts.find(PortIndex) == m_inputPorts.end())
444 {
445 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id not registered: ", PortIndex);
446 }
447 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
448 using PointerType = ManagedPortInput<DataType>;
449 using ReturnType = std::shared_ptr<PointerType>;
450 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_inputPorts[PortIndex]);
451 if (!port)
452 {
453 throw Exception(DW_BAD_CAST, "Failed to cast the following input port to its declared type: ", PortIndex);
454 }
455 return *port;
456 }
457
459 template <typename NodeT, size_t PortIndex>
461 {
462 constexpr bool isArray = descriptorPortArray<NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
463 static_assert(isArray, "Input port is not an array, must not pass an array index");
464 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::INPUT, descriptorIndex<NodeT, PortDirection::INPUT, PortIndex>()>();
465 if (arrayIndex >= arraySize)
466 {
467 throw Exception(DW_INVALID_ARGUMENT, "The array index is out of bound: ", arrayIndex);
468 }
469 if (m_inputPorts.find(PortIndex + arrayIndex) == m_inputPorts.end())
470 {
471 throw Exception(DW_INVALID_ARGUMENT, "Input port with the following id not registered: ", PortIndex + arrayIndex);
472 }
473 using DataType = decltype(portType<NodeT, PortDirection::INPUT, PortIndex>());
474 using PointerType = ManagedPortInput<DataType>;
475 using ReturnType = std::shared_ptr<PointerType>;
476 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_inputPorts[PortIndex + arrayIndex]);
477 if (!port)
478 {
479 throw Exception(DW_BAD_CAST, "Failed to cast the following input port to its declared type: ", PortIndex + arrayIndex);
480 }
481 return *port;
482 }
483
485 template <typename NodeT, size_t PortIndex>
487 {
488 constexpr bool isArray = descriptorPortArray<
489 NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
490 static_assert(!isArray, "Output port is an array, must pass an array index");
491 if (m_outputPorts.find(PortIndex) == m_outputPorts.end())
492 {
493 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id not registered: ", PortIndex);
494 }
495 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
496 using PointerType = ManagedPortOutput<DataType>;
497 using ReturnType = std::shared_ptr<PointerType>;
498 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_outputPorts[PortIndex]);
499 if (!port)
500 {
501 throw Exception(DW_BAD_CAST, "Failed to cast the following output port to its declared type: ", PortIndex);
502 }
503 return *port;
504 }
505
507 template <typename NodeT, size_t PortIndex>
509 {
510 constexpr bool isArray = descriptorPortArray<NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
511 static_assert(isArray, "Output port is not an array, must not pass an array index");
512 constexpr size_t arraySize = descriptorPortSize<NodeT, PortDirection::OUTPUT, descriptorIndex<NodeT, PortDirection::OUTPUT, PortIndex>()>();
513 if (arrayIndex >= arraySize)
514 {
515 throw Exception(DW_INVALID_ARGUMENT, "The array index is out of bound: ", arrayIndex);
516 }
517 if (m_outputPorts.find(PortIndex + arrayIndex) == m_outputPorts.end())
518 {
519 throw Exception(DW_INVALID_ARGUMENT, "Output port with the following id not registered: ", PortIndex + arrayIndex);
520 }
521 using DataType = decltype(portType<NodeT, PortDirection::OUTPUT, PortIndex>());
522 using PointerType = ManagedPortOutput<DataType>;
523 using ReturnType = std::shared_ptr<PointerType>;
524 ReturnType port = std::dynamic_pointer_cast<PointerType>(m_outputPorts[PortIndex + arrayIndex]);
525 if (!port)
526 {
527 throw Exception(DW_BAD_CAST, "Failed to cast the following output port to its declared type: ", PortIndex + arrayIndex);
528 }
529 return *port;
530 }
531
533
537 dwStatus setup();
538
540
544 dwStatus teardown();
545
547
552
557 dwStatus setIterationCount(uint32_t iterationCount) override;
558
559 const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>>& getRegisteredInputPorts() const
560 {
561 return m_inputPorts;
562 }
563
564 const dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>>& getRegisteredOutputPorts() const
565 {
566 return m_outputPorts;
567 }
568
569 uint32_t getIterationCount() const;
570
575 dwStatus setState(const char* state) override
576 {
577 static_cast<void>(state);
578 return DW_SUCCESS;
579 }
580
581protected:
582 dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>> m_inputPorts;
583 dw::core::HeapHashMap<size_t, std::shared_ptr<PortBase>> m_outputPorts;
584
585 std::atomic<bool> m_asyncResetFlag{false};
586};
587
589{
590public:
591 static constexpr char LOG_TAG[] = "SimpleSensorNode";
592
593 dwStatus start() override
594 {
595 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::start() not implemented");
596 }
597
598 dwStatus stop() override
599 {
600 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::stop() not implemented");
601 }
602
603 dwStatus isVirtual(bool*) override
604 {
605 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::isVirtual() not implemented");
606 }
607
609 {
610 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::setDataEventReadCallback() not implemented");
611 }
612
614 {
615 throw Exception(DW_NOT_IMPLEMENTED, "SimpleSensorNode::setDataEventWriteCallback() not implemented");
616 }
617};
618
621{
622public:
625};
626
627} // namespace framework
628} // namespace dw
629
630#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:305
dw::core::Function< void(DataEvent)> DataEventWriteCallback
Definition: Node.hpp:314
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:50
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:508
void resetPorts()
Default implementation to reset ports managed by the base class.
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:367
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:582
const dw::core::HeapHashMap< size_t, std::shared_ptr< PortBase > > & getRegisteredInputPorts() const
Definition: SimpleNode.hpp:559
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:383
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:583
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:564
void iterateManagedOutputPorts(Func func)
Definition: SimpleNode.hpp:158
void addPass(Pass *pass)
dwStatus run() override
dwStatus setState(const char *state) override
Definition: SimpleNode.hpp:575
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:355
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:438
void initOutputPort(Args &&... args)
Initialize a ManagedPortOutput which will be owned by the base class and can be retrieved using getOu...
Definition: SimpleNode.hpp:404
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:460
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:585
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:420
ManagedPortOutput< decltype(portType< NodeT, PortDirection::OUTPUT, PortIndex >())> & getOutputPort()
Get a previously initialized non-array ManagedPortOutput.
Definition: SimpleNode.hpp:486
SimpleProcessNode(NodeAllocationParams params)
dwStatus isVirtual(bool *) override
Definition: SimpleNode.hpp:603
dwStatus setDataEventWriteCallback(DataEventWriteCallback) override
Definition: SimpleNode.hpp:613
static constexpr char LOG_TAG[]
Definition: SimpleNode.hpp:591
dwStatus setDataEventReadCallback(DataEventReadCallback) override
Definition: SimpleNode.hpp:608
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