Class for Runnable Events (see BTF Specification Chapter 2.3.3). More...
#include <runnable.h>
Public Types | |
enum class | States { terminated , running , suspended , unknown } |
Possible types of runnable states. More... | |
enum class | Events { start , terminate , suspend , resume , unknown } |
Possible types of runnable events. More... | |
Public Member Functions | |
Runnable (States state=States::unknown) | |
Constructor of the class Runnable. More... | |
ErrorCodes | doStateTransition (Events core_event) |
Transitions the current state depending on the event. More... | |
bool | isRunning () const |
Checks, if the current runnable is in the state running. More... | |
bool | wasSuspendedByTaskPreempt () const |
Checks, if the current runnable is suspended due to a preemption. More... | |
void | setWasSuspendedByTaskPreempt (bool val) |
Sets the variable "was_suspended_by_task_preempt". More... | |
Static Public Member Functions | |
static std::string | eventToString (Events ev) |
Converts the enum Events into string. More... | |
static Events | stringToEvent (const std::string &str) |
Converts a string into the enum Events. More... | |
Class for Runnable Events (see BTF Specification Chapter 2.3.3).
A runnable (R) is called in context of a process instance or by another runnable.
A called runnable starts and changes to RUNNING. If the process instance which includes the runnable gets removed from core (e.g. preempted),
the currently executed runnable is suspended and changes to state SUSPENDED. If the process instance gets allocated to core (e.g. resumed),
the runnable changes to RUNNING. After complete execution, the runnable changes to TERMINATED.
|
strong |
Possible types of runnable events.
|
strong |
Possible types of runnable states.
btf::Runnable::Runnable | ( | States | state = States::unknown | ) |
Constructor of the class Runnable.
ErrorCodes btf::Runnable::doStateTransition | ( | Events | core_event | ) |
Transitions the current state depending on the event.
[in] | core_event | Events enum that triggered the state transition. |
|
static |
Converts the enum Events into string.
[in] | ev | Events enum that will be converted. |
bool btf::Runnable::isRunning | ( | ) | const |
Checks, if the current runnable is in the state running.
void btf::Runnable::setWasSuspendedByTaskPreempt | ( | bool | val | ) |
Sets the variable "was_suspended_by_task_preempt".
[in] | val | boolean value. |
|
static |
Converts a string into the enum Events.
[in] | str | String that will be converted. |
bool btf::Runnable::wasSuspendedByTaskPreempt | ( | ) | const |
Checks, if the current runnable is suspended due to a preemption.