MADARA  3.1.8
madara::threads::WorkUnit Class Referenceabstract

Abstract base class for implementing base threads. More...

#include <WorkUnit.h>

Public Member Functions

 WorkUnit ()
 Default constructor. More...
 
virtual void cleanup (void)
 Cleans up any thread residue (usually instances created in init). More...
 
virtual void init (knowledge::Variables &vars)
 Initializes thread with MADARA context. More...
 
virtual void run (void)=0
 Executes the main thread logic. More...
 

Private Attributes

bool critical
 Criticality. More...
 
int priority
 Task priority. More...
 

Detailed Description

Abstract base class for implementing base threads.

Definition at line 30 of file WorkUnit.h.

Constructor & Destructor Documentation

madara::threads::WorkUnit::WorkUnit ( )
inline

Default constructor.

Definition at line 36 of file WorkUnit.h.

Member Function Documentation

virtual void madara::threads::WorkUnit::cleanup ( void  )
inlinevirtual

Cleans up any thread residue (usually instances created in init).

It's important to note that the only things that would need to be cleaned up are generally ports opened, memory initialized with new/malloc, etc. Anything MADARA related is generally cleaned up for you.

Definition at line 63 of file WorkUnit.h.

virtual void madara::threads::WorkUnit::init ( knowledge::Variables vars)
inlinevirtual

Initializes thread with MADARA context.

Parameters
varscontext for querying current program state

Definition at line 46 of file WorkUnit.h.

virtual void madara::threads::WorkUnit::run ( void  )
pure virtual

Executes the main thread logic.

Member Data Documentation

bool madara::threads::WorkUnit::critical
private

Criticality.

If true, this thread's execution must complete

Definition at line 78 of file WorkUnit.h.

int madara::threads::WorkUnit::priority
private

Task priority.

Definition at line 73 of file WorkUnit.h.


The documentation for this class was generated from the following file: