rad
5.1.0
|
#include <activity.hpp>
Public Member Functions | |
ThreadActivity (const ThreadActivity &)=delete | |
ThreadActivity & | operator= (const ThreadActivity &)=delete |
virtual void | Run ()=0 |
pthread_t | GetNativeHandle () const override |
bool | IsThreadJoined () const override |
std::string | GetName () |
int | SetName (const std::string &name) |
ThreadBaseActivity (ThreadBaseActivity const &)=delete | |
![]() | |
ThreadBaseActivity (ThreadBaseActivity const &)=delete | |
void | start (scxml4cpp::Context *c) override |
void | stop (scxml4cpp::Context *c) override |
bool | IsStopRequested () const |
![]() | |
Activity (const std::string &id) | |
virtual | ~Activity () |
std::string | getId () const |
void | setId (const std::string &id) |
Protected Member Functions | |
void | StartThread () override |
void | JoinThread () override |
This class is the base class for thread-based do-activities.
User should use IsStopRequested()
to check for when to stop the activity.
Example implementation:
class MyActivity : public ThreadActivity { void Run() override { while(!IsStopRequested()) { // do work ... } } };
|
delete |
std::string rad::ThreadActivity::GetName | ( | ) |
|
overridevirtual |
TODO review whether 'const' is needed.
Implements rad::ThreadBaseActivity.
|
overridevirtual |
Implements rad::ThreadBaseActivity.
|
overrideprotectedvirtual |
Helper method to stop a do-activity thread.
Implements rad::ThreadBaseActivity.
|
delete |
|
pure virtual |
Interface to be implemented by child classes to implement the activity thread.
Implemented in MyTestDoActivity, rad::ActivityUpdateOldb, server::ActivityMoving, exmalserver::ActivityMoving, exciiserver::ActivityMoving, and rad::utest::Activity.
int rad::ThreadActivity::SetName | ( | const std::string & | name | ) |
Set thread name.
[in] | name | for the thread. Maximum length is 15 characters (excluding null terminator). |
|
overrideprotectedvirtual |
Helper method to start a do-activity thread.
Implements rad::ThreadBaseActivity.
|
delete |