MADARA
3.1.8
|
A thread that executes BaseThread logic. More...
#include <WorkerThread.h>
Public Member Functions | |
WorkerThread () | |
Default constructor. More... | |
WorkerThread (const std::string &name, BaseThread *thread, knowledge::KnowledgeBase *control, knowledge::KnowledgeBase *data, double hertz=-1.0) | |
Constructor. More... | |
WorkerThread (const WorkerThread &input)=delete | |
Copy constructor deleted, because ACE_Task doesn't support it. More... | |
~WorkerThread () | |
Destructor. More... | |
void | operator= (const WorkerThread &input) |
Assignment operator. More... | |
void | run (void) |
Runs the thread once. More... | |
int | svc (void) |
Reads messages from a socket. More... | |
Protected Member Functions | |
void | change_frequency (double hertz, ACE_Time_Value ¤t, ACE_Time_Value &frequency, ACE_Time_Value &next_epoch, bool &one_shot, bool &blaster) |
Changes the frequency given a hertz rate. More... | |
Protected Attributes | |
knowledge::KnowledgeBase * | control_ |
the control plane to the knowledge base More... | |
knowledge::KnowledgeBase * | data_ |
the data plane (the knowledge base) More... | |
knowledge::containers::Integer | finished_ |
thread safe finished flag that will be sent to the knowledge base on completion of the thread More... | |
double | hertz_ |
hertz rate for worker thread executions More... | |
std::string | name_ |
the name of the contained thread More... | |
knowledge::containers::Double | new_hertz_ |
thread safe hertz reference More... | |
knowledge::containers::Integer | started_ |
thread safe start flag that will be sent to the knowledge base on launch of the thread More... | |
BaseThread * | thread_ |
the contained thread More... | |
Friends | |
class | Threader |
give access to our status flags to the Threader class More... | |
madara::threads::WorkerThread::WorkerThread | ( | ) |
Default constructor.
Definition at line 37 of file WorkerThread.cpp.
madara::threads::WorkerThread::WorkerThread | ( | const std::string & | name, |
BaseThread * | thread, | ||
knowledge::KnowledgeBase * | control, | ||
knowledge::KnowledgeBase * | data, | ||
double | hertz = -1.0 |
||
) |
Constructor.
name | the name of the user thread |
thread | the user thread |
control | the knowledge base that provides a control plane between the data knowledge base and threads |
data | the knowledge base that provides user data access |
hertz | the hertz rate to run the thread |
Definition at line 43 of file WorkerThread.cpp.
|
delete |
Copy constructor deleted, because ACE_Task doesn't support it.
madara::threads::WorkerThread::~WorkerThread | ( | ) |
Destructor.
Definition at line 73 of file WorkerThread.cpp.
|
inlineprotected |
Changes the frequency given a hertz rate.
hertz | the new hertz rate |
current | current time |
frequency | an updated frequency value |
next_epoch | next time to trigger execution |
one_shot | if hertz rate is less than 0, true. Otherwise, false |
blaster | if hertz rate is 0, true. Otherwise, false. |
Definition at line 15 of file WorkerThread.inl.
void madara::threads::WorkerThread::operator= | ( | const WorkerThread & | input | ) |
Assignment operator.
input | thread information to copy |
Definition at line 78 of file WorkerThread.cpp.
void madara::threads::WorkerThread::run | ( | void | ) |
Runs the thread once.
Definition at line 94 of file WorkerThread.cpp.
int madara::threads::WorkerThread::svc | ( | void | ) |
Reads messages from a socket.
Definition at line 121 of file WorkerThread.cpp.
|
friend |
give access to our status flags to the Threader class
Definition at line 35 of file WorkerThread.h.
|
protected |
the control plane to the knowledge base
Definition at line 108 of file WorkerThread.h.
|
protected |
the data plane (the knowledge base)
Definition at line 111 of file WorkerThread.h.
|
protected |
thread safe finished flag that will be sent to the knowledge base on completion of the thread
Definition at line 117 of file WorkerThread.h.
|
protected |
hertz rate for worker thread executions
Definition at line 133 of file WorkerThread.h.
|
protected |
the name of the contained thread
Definition at line 102 of file WorkerThread.h.
|
protected |
thread safe hertz reference
Definition at line 128 of file WorkerThread.h.
|
protected |
thread safe start flag that will be sent to the knowledge base on launch of the thread
Definition at line 123 of file WorkerThread.h.
|
protected |
the contained thread
Definition at line 105 of file WorkerThread.h.