The MAUVE Toolchain
mauve::runtime::Task Class Referencefinal

A system Task that executes a component. More...

#include <Task.hpp>

Collaboration diagram for mauve::runtime::Task:

Public Member Functions

 Task (AbstractComponent *component)
 Create a task associated to a component. More...
 
 ~Task ()
 Task Destructor. More...
 
bool activate ()
 Activate the task. More...
 
AbstractComponentget_component ()
 Get the component associated to this task. More...
 
TaskStatus get_status () const
 
time_ns_t get_time () const
 Get the clock of the task. More...
 
bool start (time_ns_t start_time, pthread_barrier_t *barrier=nullptr)
 Start the task. More...
 
bool stop ()
 Stop the task. More...
 
pthread_t thread_id () const
 Get the thread ID of this task. More...
 
std::string to_string () const
 Get a string representation of this task. More...
 

Protected Attributes

ComponentLoggerlogger
 A pointer to a logger. More...
 

Detailed Description

A system Task that executes a component.

Constructor & Destructor Documentation

mauve::runtime::Task::Task ( AbstractComponent component)

Create a task associated to a component.

Parameters
componentthe component owned by the task
mauve::runtime::Task::~Task ( )

Task Destructor.

Member Function Documentation

bool mauve::runtime::Task::activate ( )

Activate the task.

Returns
true if activation succeeds.
AbstractComponent* mauve::runtime::Task::get_component ( )

Get the component associated to this task.

Returns
a pointer to the component
time_ns_t mauve::runtime::Task::get_time ( ) const

Get the clock of the task.

Returns
currect time
bool mauve::runtime::Task::start ( time_ns_t  start_time,
pthread_barrier_t *  barrier = nullptr 
)

Start the task.

Parameters
start_timethe desired start time of the task
barriera starting barrier
Returns
true if starting succeeds.
bool mauve::runtime::Task::stop ( )

Stop the task.

Returns
true if stopping succeeds
pthread_t mauve::runtime::Task::thread_id ( ) const

Get the thread ID of this task.

Returns
the thread ID
std::string mauve::runtime::Task::to_string ( ) const

Get a string representation of this task.

Returns
a string

Member Data Documentation

ComponentLogger* mauve::runtime::Task::logger
protected

A pointer to a logger.