21#ifndef HEDGEHOG_TASK_NODE_ABSTRACTION_H
22#define HEDGEHOG_TASK_NODE_ABSTRACTION_H
26#include "../../../../api/memory_manager/manager/abstract_memory_manager.h"
27#include "../../../../tools/nvtx_profiler.h"
28#include "../printable_abstraction.h"
35namespace abstraction {
46 std::chrono::nanoseconds
51 std::shared_ptr<NvtxProfiler>
99 std::chrono::nanoseconds::zero() :
143 [[nodiscard]]
virtual std::shared_ptr<AbstractMemoryManager>
memoryManager()
const = 0;
Behavior abstraction for the base node.
Base core node abstraction.
std::string const & name() const
Accessor to the core's name.
Task core abstraction used to define some method for task-like behaving cores like CoreExecutionPipel...
size_t numberReceivedElements_
Number of elements received.
bool isActive_
Active flag.
void incrementNumberReceivedElements()
Increment the number of elements received.
void incrementWaitDuration(std::chrono::nanoseconds const &wait)
Increment the wait duration.
std::chrono::nanoseconds const & memoryWaitDuration() const
Accessor to the duration the node was in a memory wait state.
void setInitialized()
Set the task as initialized.
behavior::Node * node() const override
Node accessor.
TaskNodeAbstraction(std::string const &name, behavior::Node *node)
Create the abstraction with the node's name.
virtual std::string extraPrintingInformation() const =0
Abstraction to add user-defined message for the printers.
std::chrono::nanoseconds waitDuration_
Node wait duration.
behavior::Node * node_
Node attache to this task-like core.
virtual std::shared_ptr< AbstractMemoryManager > memoryManager() const =0
Accessor to the attached memory manager.
std::shared_ptr< NvtxProfiler > nvtxProfiler_
Store hedgehog nvtx profiler for the task.
virtual void preRun()=0
Pre run method, called only once.
~TaskNodeAbstraction() override=default
Default destructor.
std::chrono::nanoseconds perElementExecutionDuration() const
Accessor to the duration the average duration of processing an input data.
bool isInitialized() const
Accessor to initialized flag.
void isActive(bool isActive)
Setter to the task status.
virtual void run()=0
Run method, called when thread is attached.
std::chrono::nanoseconds perElementExecutionDuration_
Node per element duration.
std::shared_ptr< NvtxProfiler > const & nvtxProfiler() const
Accessor to the NVTX profiler attached to the node.
bool isActive() const
Accessor to task status.
bool isInitialized_
Is initialized flag.
void incrementPerElementExecutionDuration(std::chrono::nanoseconds const &exec)
Increase the execution time per elements.
virtual bool hasMemoryManagerAttached() const =0
Flag accessor to the presence of memory manager attached.
std::chrono::nanoseconds memoryWaitDuration_
Node memory wait duration.
std::chrono::nanoseconds const & waitDuration() const
Accessor to the duration the node was in a wait state.
void incrementMemoryWaitDuration(std::chrono::nanoseconds const &wait)
Increase the memory wait duration.
size_t numberReceivedElements() const
Accessor to the number of received elements.
virtual void postRun()=0
Post run method, called only once.
PrintAbstraction, used to determine if the node should be visited by the printer and colored.