ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
TestThread Class Reference
Inheritance diagram for TestThread:
ctd::mptk::Thread

Public Member Functions

 TestThread (const std::string &thread_id, ctd::mptk::MessageBus &message_bus, const double period=0.1)
 
 ~TestThread ()
 
void UserLogic ()
 User provided business logic. The UserLogic method need not execute an internal loop. It is taken care of by the Control() method. Instead the UserLogic() method should (normally) execute it business logic, and return control to the Control() method, which will take of the thread management. More...
 
- Public Member Functions inherited from ctd::mptk::Thread
 Thread (const std::string &thread_id, MessageBus &message_bus, const double period=0.1)
 Constructor method, setting up the internal members. More...
 
virtual ~Thread ()
 
std::string Id ()
 Return the thread ID. More...
 
void Loop ()
 Method to invoke the user provided business logic of the thread. More...
 
void Start ()
 Start the thread execution. More...
 
void Stop ()
 Stop the thread execution. More...
 
void Pause ()
 Pause the thread execution. More...
 
bool CheckExecFlag ()
 Check the Thread Execution Flag. The Thread Execution Flag shall be called regularly in the thread, at least during every internal cycle (of LogicUser()). The behavior is as follows: THREAD_EXEC_RUNNING: Return immediately with true. THREAD_EXEC_PAUSED: Wait internally for flag to change to THREAD_EXEC_RUN/_STOP. TRHEAD_EXEC_STOPPED: Return immediately with false. Thread LogicUser() shall return. More...
 
ThreadExecControl GetExecFlag () const
 Return the value of the Thread Execution Flag. More...
 
bool Terminated () const
 Returns true if thread no longer running. More...
 
MessageBusMsgBus ()
 Get acces to the MessageBus associated with this thread object. More...
 
std::string Print () const
 Generate ASCII output providing a status of the object. More...
 
 Thread (const std::string &thread_id, MessageBus &message_bus, const double period=0.1)
 Constructor method, setting up the internal members. More...
 
virtual ~Thread ()
 
std::string Id ()
 Return the thread ID. More...
 
void Loop ()
 Method to invoke the user provided business logic of the thread. More...
 
void Start ()
 Start the thread execution. More...
 
void Stop ()
 Stop the thread execution. More...
 
void Pause ()
 Pause the thread execution. More...
 
bool CheckExecFlag ()
 Check the Thread Execution Flag. The Thread Execution Flag shall be called regularly in the thread, at least during every internal cycle (of LogicUser()). The behavior is as follows: THREAD_EXEC_RUNNING: Return immediately with true. THREAD_EXEC_PAUSED: Wait internally for flag to change to THREAD_EXEC_RUN/_STOP. TRHEAD_EXEC_STOPPED: Return immediately with false. Thread LogicUser() shall return. More...
 
ThreadExecControl GetExecFlag () const
 Return the value of the Thread Execution Flag. More...
 
bool Terminated () const
 Returns true if thread no longer running. More...
 
MessageBusMsgBus ()
 Get acces to the MessageBus associated with this thread object. More...
 
std::string Print () const
 Generate ASCII output providing a status of the object. More...
 
 Thread (const std::string &thread_id, MessageBus &message_bus, const double period=0.1)
 Constructor method, setting up the internal members. More...
 
virtual ~Thread ()
 
std::string Id ()
 Return the thread ID. More...
 
void Loop ()
 Method to invoke the user provided business logic of the thread. More...
 
void Start ()
 Start the thread execution. More...
 
void Stop ()
 Stop the thread execution. More...
 
void Pause ()
 Pause the thread execution. More...
 
bool CheckExecFlag ()
 Check the Thread Execution Flag. The Thread Execution Flag shall be called regularly in the thread, at least during every internal cycle (of LogicUser()). The behavior is as follows: THREAD_EXEC_RUNNING: Return immediately with true. THREAD_EXEC_PAUSED: Wait internally for flag to change to THREAD_EXEC_RUN/_STOP. TRHEAD_EXEC_STOPPED: Return immediately with false. Thread LogicUser() shall return. More...
 
ThreadExecControl GetExecFlag () const
 Return the value of the Thread Execution Flag. More...
 
bool Terminated () const
 Returns true if thread no longer running. More...
 
MessageBusMsgBus ()
 Get acces to the MessageBus associated with this thread object. More...
 
std::string Print () const
 Generate ASCII output providing a status of the object. More...
 

Additional Inherited Members

- Public Types inherited from ctd::mptk::Thread
enum  ThreadExecControl {
  THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1,
  THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING,
  THREAD_EXEC_PAUSED
}
 Thread execution control/status. More...
 
enum  ThreadExecControl {
  THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1,
  THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING,
  THREAD_EXEC_PAUSED
}
 Thread execution control/status. More...
 
enum  ThreadExecControl {
  THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1,
  THREAD_EXEC_RUNNING, THREAD_EXEC_PAUSED, THREAD_EXEC_STOPPED = 1, THREAD_EXEC_RUNNING,
  THREAD_EXEC_PAUSED
}
 Thread execution control/status. More...
 
- Static Public Attributes inherited from ctd::mptk::Thread
static std::map< std::string,
Thread * > 
s_thread_registry
 
static const std::string THREAD_REGISTRY = "ThreadRegistry"
 

Detailed Description

Constructor & Destructor Documentation

TestThread::TestThread ( const std::string &  thread_id,
ctd::mptk::MessageBus message_bus,
const double  period = 0.1 
)
inline
TestThread::~TestThread ( )
inline

Member Function Documentation

void TestThread::UserLogic ( )
inlinevirtual

User provided business logic. The UserLogic method need not execute an internal loop. It is taken care of by the Control() method. Instead the UserLogic() method should (normally) execute it business logic, and return control to the Control() method, which will take of the thread management.

Reimplemented from ctd::mptk::Thread.


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