btftoolchain
btf::Core Class Reference

Class for the core (C) events. More...

#include <core.h>

Public Types

enum class  States { idle , execution , unknown }
 Possible types of core states. More...
 
enum class  Events { idle , execute , set_frequence , unknown }
 Possible types of core events. More...
 

Public Member Functions

 Core (States state=States::unknown)
 Constructor of the class Core. More...
 
ErrorCodes doStateTransition (Events core_event)
 Transitions the current state depending on the event. More...
 
bool isIdle () const
 Checks, if the current core is in the state idle. More...
 
bool isStateUnknown () const
 Checks, if the current core is in the state unknown. 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...
 

Detailed Description

Class for the core (C) events.

Core events indicate if interrupts are suspended on a core.

Member Enumeration Documentation

◆ Events

enum btf::Core::Events
strong

Possible types of core events.

Enumerator
idle 

The idle event indicates that the core is going into the idle state.

execute 

The execute event indicates that the core is going into the execution state.

set_frequence 
unknown 

Default state.

◆ States

enum btf::Core::States
strong

Possible types of core states.

Enumerator
idle 

The core is currently idle.

execution 

The core is currently executing a process instance.

unknown 

Default state.

Constructor & Destructor Documentation

◆ Core()

btf::Core::Core ( States  state = States::unknown)

Constructor of the class Core.

Member Function Documentation

◆ doStateTransition()

ErrorCodes btf::Core::doStateTransition ( Events  core_event)

Transitions the current state depending on the event.

Parameters
[in]core_eventEvents enum that triggered the state transition.
Returns
ErrorCodes enum.

◆ eventToString()

std::string btf::Core::eventToString ( Events  ev)
static

Converts the enum Events into string.

Parameters
[in]evEvents enum that will be converted.
Returns
String if Events type is valid, else a fatal error is triggered.
Here is the caller graph for this function:

◆ isIdle()

bool btf::Core::isIdle ( ) const

Checks, if the current core is in the state idle.

Returns
True if the current state is idle, else false.

◆ isStateUnknown()

bool btf::Core::isStateUnknown ( ) const

Checks, if the current core is in the state unknown.

Returns
True if the current state is unknown, else false.

◆ stringToEvent()

Core::Events btf::Core::stringToEvent ( const std::string &  str)
static

Converts a string into the enum Events.

Parameters
[in]strString that will be converted.
Returns
Events enum.
Here is the caller graph for this function:

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