#include <pthreadActivity.hpp>
This class is the base class for pthread-based do-activities.
- Todo:
- : move to std::threads
- Todo:
- : add common base class
- Todo:
- : add fiber based activity
◆ PthreadActivity() [1/2]
rad::PthreadActivity::PthreadActivity |
( |
const std::string & |
id, |
|
|
const int |
cpu = -1 , |
|
|
const int |
priority = -1 |
|
) |
| |
|
explicit |
Constructor for the PthreadActivity class.
- Parameters
-
[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. |
◆ ~PthreadActivity()
rad::PthreadActivity::~PthreadActivity |
( |
| ) |
|
|
virtual |
◆ PthreadActivity() [2/2]
◆ GetConfiguredCPU()
int rad::PthreadActivity::GetConfiguredCPU |
( |
| ) |
const |
- Returns
- the CPU on which the thread was configured to run.
◆ GetConfiguredPriority()
int rad::PthreadActivity::GetConfiguredPriority |
( |
| ) |
const |
- Returns
- the configured priority for this thread.
◆ GetCPU()
int rad::PthreadActivity::GetCPU |
( |
| ) |
const |
- Returns
- the CPU on which the thread is running. It has to be invoked from the running method, otherwise it returns the CPU where the main thread is running.
◆ GetName()
std::string rad::PthreadActivity::GetName |
( |
| ) |
|
- Returns
- The name of the do-activity thread.
◆ GetNativeHandle()
pthread_t rad::PthreadActivity::GetNativeHandle |
( |
| ) |
const |
|
overridevirtual |
- Precondition
- Activity must have been started.
- Returns
- The posix handle to the thread.
Implements rad::ThreadBaseActivity.
◆ GetPriority()
int rad::PthreadActivity::GetPriority |
( |
| ) |
|
- Returns
- the priority of this thread (> 0) or the error code (< 0).
◆ IsThreadJoined()
bool rad::PthreadActivity::IsThreadJoined |
( |
| ) |
const |
|
overrideprotectedvirtual |
◆ JoinThread()
void rad::PthreadActivity::JoinThread |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ operator=()
Disable copy constructor.
◆ Run()
virtual void rad::PthreadActivity::Run |
( |
| ) |
|
|
pure virtual |
◆ SetConfiguredCPU()
void rad::PthreadActivity::SetConfiguredCPU |
( |
const int |
cpu | ) |
|
Configure the CPU on which the thread should be executed.
- Parameters
-
[in] | cpu | New core identifier. |
◆ SetConfiguredPriority()
void rad::PthreadActivity::SetConfiguredPriority |
( |
const int |
priority | ) |
|
Configure the priority for this thread.
- Parameters
-
[in] | priority | New thread priority. |
◆ SetName()
int rad::PthreadActivity::SetName |
( |
const std::string & |
name | ) |
|
- Parameters
-
- Returns
- error code or 0 if successful.
◆ StartThread()
void rad::PthreadActivity::StartThread |
( |
| ) |
|
|
overrideprotectedvirtual |
The documentation for this class was generated from the following files: