MADARA
3.1.8
|
Abstract base class for implementing threads. More...
#include <BaseThread.h>
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... | |
Abstract base class for implementing threads.
Definition at line 38 of file BaseThread.h.
|
inlinevirtual |
Destructor.
Definition at line 44 of file BaseThread.h.
|
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.
|
inlinevirtual |
Initializes thread with a MADARA context.
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 59 of file BaseThread.h.
|
inlineprotectedvirtual |
Initializes the Java thread implementation's control plane variables.
control | the control plane between Threader and threads |
Reimplemented in madara::threads::JavaThread.
Definition at line 86 of file BaseThread.h.
|
pure virtual |
Executes the main thread logic.
In a BaseThread, the execute is called once. Afterwards, cleanup is called.
Implemented 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.
|
friend |
Definition at line 54 of file BaseThread.h.
|
friend |
Worker threads are MADARA thread entities that manage user-defined threads.
Definition at line 53 of file BaseThread.h.
|
protected |
The unique name of your thread.
Definition at line 96 of file BaseThread.h.
|
protected |
thread safe paused flag that may be set by the Threader
Definition at line 107 of file BaseThread.h.
|
protected |
thread safe terminated flag that may be set by the Threader base
Definition at line 102 of file BaseThread.h.