20 #ifndef HEDGEHOG_CORE_DEFAULT_TASK_H 21 #define HEDGEHOG_CORE_DEFAULT_TASK_H 23 #include "../node/core_task.h" 29 #if defined (__clang__) 30 #pragma clang diagnostic push 31 #pragma clang diagnostic ignored "-Woverloaded-virtual" 33 template<
class TaskInput,
class TaskOutput,
class ...TaskInputs>
56 CoreTask<TaskOutput, TaskInputs...>(name,
65 HLOG_SELF(2,
"Call execute")
71 #if defined (__clang__) 72 #pragma clang diagnostic pop 78 template<
class TaskOutput,
class ...TaskInputs>
100 CoreTask<TaskOutput, TaskInputs...>(name, numberThreads, type, task, automaticStart),
101 DefaultCoreTaskExecute<TaskInputs, TaskOutput, TaskInputs...>(name, numberThreads, type, task, automaticStart)...{
109 std::shared_ptr<CoreNode>
clone()
override {
117 HLOG_SELF(0,
"Initialize Memory manager for the task " << this->
name() <<
" / " << this->
id())
122 if (this->
task()->memoryManager() !=
nullptr) {
144 #endif //HEDGEHOG_CORE_DEFAULT_TASK_H NodeType type() const
Node type accessor.
virtual void shutdown()
Shutdown method called after AbstractTask::Execute loop, when AbstractTask::canTerminate evaluates to...
Receiver Interface, receive one data type from CoreSender.
void postRun() override
Defines what a CoreDefaultTask does after the execute loop.
Middle class used to propose a default definition of CoreExecute::callExecute for CoreDefaultTask...
Core Notifier interface, emit notification to CoreSlot.
virtual void initialize()
Initialize method called before AbstractTask::Execute loop.
bool isActive() const
Is active property accessor.
std::shared_ptr< AbstractTask< TaskOutput, TaskInputs... > > createCopyFromThis()
Create a copy from this instance.
Sender for nodes possessing a queue of data.
void notifyAllTerminated() override
Notify all slots that the node is terminated.
Slot interface, receive notification from CoreNotifier.
Core of the default Task to be use.
void preRun() override
Defines what a CoreDefaultTask does before the execute loop.
NodeType
Hedgehog node's type.
Main Hedgehog core abstraction.
Notifier of CoreQueueSlot.
CoreDefaultTask(std::string_view const &name, size_t const numberThreads, NodeType const type, AbstractTask< TaskOutput, TaskInputs... > *task, bool automaticStart)
CoreDefaultTask constructor.
std::shared_ptr< AbstractMemoryManager< TaskOutput > > const & memoryManager() const
Task's memory manager accessor.
std::string_view const & name() const
Node name accessor.
std::shared_ptr< CoreNode > clone() override
Clone overload for CoreDefaultTask.
Execute Behavior definition, node that has an execution for an Input data type.
bool automaticStart() const
Automatic start property accessor.
AbstractTask< TaskOutput, TaskInputs... > * task() const
Node accessor.
size_t numberThreads() const
Number of threads associated accessor.
virtual int deviceId()
Device id accessor.
std::shared_ptr< NvtxProfiler > & nvtxProfiler()
NVTX profiler accessor.
void callExecute(std::shared_ptr< TaskInput > data) final
Definition of CoreExecute::callExecute for DefaultCoreTaskExecute.
DefaultCoreTaskExecute(std::string_view const &name, size_t const numberThreads, NodeType const type, AbstractTask< TaskOutput, TaskInputs... > *task, bool automaticStart)
DefaultCoreTaskExecute constructor.