|
rad 6.2.0
|
#include <pthreadActivity.hpp>
Public Member Functions | |
| PthreadActivity (const std::string &id, const int cpu=-1, const int priotity=-1) | |
| virtual | ~PthreadActivity () |
| virtual void | Run ()=0 |
| std::string | GetName () |
| int | SetName (const std::string &name) |
| int | GetCPU () const |
| int | GetConfiguredCPU () const |
| void | SetConfiguredCPU (const int cpu) |
| int | GetPriority () |
| int | GetConfiguredPriority () const |
| void | SetConfiguredPriority (const int priority) |
| pthread_t | GetNativeHandle () const override |
| PthreadActivity (const PthreadActivity &)=delete | |
| PthreadActivity & | operator= (const PthreadActivity &)=delete |
| Disable copy constructor. | |
Public Member Functions inherited from rad::ThreadBaseActivity | |
| ThreadBaseActivity (ThreadBaseActivity const &)=delete | |
| void | start (scxml4cpp::Context *c) override |
| void | stop (scxml4cpp::Context *c) override |
| bool | IsStopRequested () const |
Public Member Functions inherited from scxml4cpp::Activity | |
| Activity (const std::string &id) | |
| virtual | ~Activity () |
| std::string | getId () const |
| void | setId (const std::string &id) |
Protected Member Functions | |
| void | StartThread () override |
| Disable assignment operator. | |
| void | JoinThread () override |
| bool | IsThreadJoined () const override |
This class is the base class for pthread-based do-activities.
: move to std::threads
: add common base class
: add fiber based activity
|
explicit |
Constructor for the PthreadActivity class.
| [in] | id | Identifier of the do-activity. |
| [in] | cpu | Core where to run the thread associated to the activity. |
| [in] | priority | Priority of the thread associated to the activity. |
|
virtual |
Destructor for the PthreadActivity class.
|
delete |
| int rad::PthreadActivity::GetConfiguredCPU | ( | ) | const |
| int rad::PthreadActivity::GetConfiguredPriority | ( | ) | const |
| int rad::PthreadActivity::GetCPU | ( | ) | const |
| std::string rad::PthreadActivity::GetName | ( | ) |
|
overridevirtual |
Implements rad::ThreadBaseActivity.
| int rad::PthreadActivity::GetPriority | ( | ) |
|
overrideprotectedvirtual |
Interface to be implemented by child classes to verify whether the thread is running or not.
Implements rad::ThreadBaseActivity.
|
overrideprotectedvirtual |
Helper method to stop a do-activity thread.
Implements rad::ThreadBaseActivity.
|
delete |
Disable copy constructor.
|
pure virtual |
Implemented in MyTestDoActivityPthread.
| void rad::PthreadActivity::SetConfiguredCPU | ( | const int | cpu | ) |
Configure the CPU on which the thread should be executed.
| [in] | cpu | New core identifier. |
| void rad::PthreadActivity::SetConfiguredPriority | ( | const int | priority | ) |
Configure the priority for this thread.
| [in] | priority | New thread priority. |
| int rad::PthreadActivity::SetName | ( | const std::string & | name | ) |
| [in] | name | for the thread. |
|
overrideprotectedvirtual |
Disable assignment operator.
Helper method to start a do-activity thread.
Implements rad::ThreadBaseActivity.