Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
hh::behavior::TaskNode Class Reference

Behavior abstraction for TaskNode. More...

#include "task_node.h"

Inheritance diagram for hh::behavior::TaskNode:
Inheritance graph
Collaboration diagram for hh::behavior::TaskNode:
Collaboration graph

Public Member Functions

 TaskNode (std::shared_ptr< hh::core::abstraction::TaskNodeAbstraction > core)
 Constructor using a core.
 
 ~TaskNode () override=default
 Default destructor.
 
std::shared_ptr< AbstractMemoryManager > const & memoryManager () const
 Memory manager accessor.
 
void connectMemoryManager (std::shared_ptr< AbstractMemoryManager > mm)
 Connect a memory manager to a task.
 
std::shared_ptr< ManagedMemorygetManagedMemory ()
 Get a managed memory for the memory manager attached to the task, can block if none are available at the time of the call.
 
virtual void initialize ()
 initialize step for the task
 
virtual void shutdown ()
 shutdown step for the task
 
virtual std::string extraPrintingInformation () const
 Print extra information for the task.
 
- Public Member Functions inherited from hh::behavior::Node
 Node (std::shared_ptr< hh::core::abstraction::NodeAbstraction > core)
 Constructor's node.
 
virtual ~Node ()=default
 Default destructor.
 
std::shared_ptr< hh::core::abstraction::NodeAbstraction > const & core () const
 Core accessor.
 
std::string name () const
 Node's name accessor.
 

Private Attributes

std::shared_ptr< AbstractMemoryManagermm_ = nullptr
 Memory manager attached to the task.
 
std::shared_ptr< hh::core::abstraction::TaskNodeAbstraction > const taskNodeAbstraction_ = nullptr
 Core abstraction for the task.
 

Detailed Description

Behavior abstraction for TaskNode.

Proposed abstraction for attached memory manager and user overloadable method (initialize, shutdown, extraPrintingInformation)

Definition at line 35 of file task_node.h.

Constructor & Destructor Documentation

◆ TaskNode()

hh::behavior::TaskNode::TaskNode ( std::shared_ptr< hh::core::abstraction::TaskNodeAbstraction core)
inlineexplicit

Constructor using a core.

Parameters
coreTask core

Definition at line 44 of file task_node.h.

◆ ~TaskNode()

hh::behavior::TaskNode::~TaskNode ( )
overridedefault

Default destructor.

Member Function Documentation

◆ connectMemoryManager()

void hh::behavior::TaskNode::connectMemoryManager ( std::shared_ptr< AbstractMemoryManager mm)
inline

Connect a memory manager to a task.

Parameters
mmMemory manager to attach to t he node

Definition at line 57 of file task_node.h.

◆ extraPrintingInformation()

virtual std::string hh::behavior::TaskNode::extraPrintingInformation ( ) const
inlinevirtual

Print extra information for the task.

Returns
string with extra information

Definition at line 89 of file task_node.h.

Here is the caller graph for this function:

◆ getManagedMemory()

std::shared_ptr< ManagedMemory > hh::behavior::TaskNode::getManagedMemory ( )
inline

Get a managed memory for the memory manager attached to the task, can block if none are available at the time of the call.

Returns
A managed memory
Exceptions
std::runtime_errorif no memory manager is attached to the task

Definition at line 63 of file task_node.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

virtual void hh::behavior::TaskNode::initialize ( )
inlinevirtual

initialize step for the task

Reimplemented in hh::AbstractCUDATask< Separator, AllTypes >.

Definition at line 82 of file task_node.h.

Here is the caller graph for this function:

◆ memoryManager()

std::shared_ptr< AbstractMemoryManager > const & hh::behavior::TaskNode::memoryManager ( ) const
inline

Memory manager accessor.

Returns
Attached memory manager

Definition at line 53 of file task_node.h.

Here is the caller graph for this function:

◆ shutdown()

virtual void hh::behavior::TaskNode::shutdown ( )
inlinevirtual

shutdown step for the task

Reimplemented in hh::AbstractCUDATask< Separator, AllTypes >.

Definition at line 85 of file task_node.h.

Here is the caller graph for this function:

Member Data Documentation

◆ mm_

std::shared_ptr<AbstractMemoryManager> hh::behavior::TaskNode::mm_ = nullptr
private

Memory manager attached to the task.

Definition at line 38 of file task_node.h.

◆ taskNodeAbstraction_

std::shared_ptr<hh::core::abstraction::TaskNodeAbstraction> const hh::behavior::TaskNode::taskNodeAbstraction_ = nullptr
private

Core abstraction for the task.

Definition at line 40 of file task_node.h.