MADARA  3.1.8
madara::threads::BaseThread Class Referenceabstract

Abstract base class for implementing threads. More...

#include <BaseThread.h>

Inheritance diagram for madara::threads::BaseThread:
Collaboration diagram for madara::threads::BaseThread:

Public Member Functions

virtual ~BaseThread ()
 Destructor. More...
 
virtual void cleanup (void)
 Cleans up any thread residue (usually instances created in init). More...
 
virtual void init (knowledge::KnowledgeBase &)
 Initializes thread with a MADARA context. More...
 
virtual void run (void)=0
 Executes the main thread logic. More...
 

Protected Member Functions

virtual void init_control_vars (knowledge::KnowledgeBase &control)
 Initializes the Java thread implementation's control plane variables. More...
 

Protected Attributes

std::string name
 The unique name of your thread. More...
 
madara::knowledge::containers::Integer paused
 thread safe paused flag that may be set by the Threader More...
 
madara::knowledge::containers::Integer terminated
 thread safe terminated flag that may be set by the Threader base More...
 

Friends

class Threader
 
class WorkerThread
 Worker threads are MADARA thread entities that manage user-defined threads. More...
 

Detailed Description

Abstract base class for implementing threads.

Definition at line 38 of file BaseThread.h.

Constructor & Destructor Documentation

virtual madara::threads::BaseThread::~BaseThread ( )
inlinevirtual

Destructor.

Definition at line 44 of file BaseThread.h.

Member Function Documentation

virtual void madara::threads::BaseThread::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.

Reimplemented in madara::threads::RCWThread, madara::transport::BroadcastTransportReadThread, madara::transport::MulticastTransportReadThread, madara::transport::SpliceReadThread, madara::transport::ZMQTransportReadThread, madara::transport::UdpRegistryServerReadThread, madara::transport::UdpTransportReadThread, madara::transport::UdpRegistryClientReadThread, madara::transport::TcpTransportReadThread, and madara::threads::JavaThread.

Definition at line 76 of file BaseThread.h.

virtual void madara::threads::BaseThread::init_control_vars ( knowledge::KnowledgeBase control)
inlineprotectedvirtual

Initializes the Java thread implementation's control plane variables.

Parameters
controlthe control plane between Threader and threads

Reimplemented in madara::threads::JavaThread.

Definition at line 86 of file BaseThread.h.

Friends And Related Function Documentation

friend class Threader
friend

Definition at line 54 of file BaseThread.h.

friend class WorkerThread
friend

Worker threads are MADARA thread entities that manage user-defined threads.

Definition at line 53 of file BaseThread.h.

Member Data Documentation

std::string madara::threads::BaseThread::name
protected

The unique name of your thread.

Definition at line 96 of file BaseThread.h.

madara::knowledge::containers::Integer madara::threads::BaseThread::paused
protected

thread safe paused flag that may be set by the Threader

Definition at line 107 of file BaseThread.h.

madara::knowledge::containers::Integer madara::threads::BaseThread::terminated
protected

thread safe terminated flag that may be set by the Threader base

Definition at line 102 of file BaseThread.h.


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