F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Os::Cpu Class Referencefinal

cpu implementation More...

#include <Os/Cpu.hpp>

Inheritance diagram for Os::Cpu:
Os::CpuInterface

Public Member Functions

 Cpu ()
 default constructor More...
 
 ~Cpu () final
 default virtual destructor More...
 
 Cpu (const CpuInterface &other)=delete
 copy constructor is forbidden More...
 
 Cpu (const CpuInterface *other)=delete
 copy constructor is forbidden More...
 
CpuInterfaceoperator= (const CpuInterface &other) override=delete
 assignment operator is forbidden More...
 
Status _getCount (FwSizeType &cpu_count) override
 Request the count of the CPUs detected by the system. More...
 
Status _getTicks (Ticks &ticks, FwSizeType cpu_index) override
 Get the CPU tick information for a given CPU. More...
 
CpuHandlegetHandle () override
 return the underlying cpu handle (implementation specific). More...
 
- Public Member Functions inherited from Os::CpuInterface
 CpuInterface ()=default
 Default constructor. More...
 
virtual ~CpuInterface ()=default
 Default destructor. More...
 
 CpuInterface (const CpuInterface &other)=delete
 copy constructor is forbidden More...
 

Static Public Member Functions

static void init ()
 initialize the singleton More...
 
static CpugetSingleton ()
 return singleton More...
 
static Status getCount (FwSizeType &cpu_count)
 Request the count of the CPUs detected by the system. More...
 
static Status getTicks (Ticks &ticks, FwSizeType cpu_index)
 Get the CPU tick information for a given CPU. More...
 
- Static Public Member Functions inherited from Os::CpuInterface
static CpuInterfacegetDelegate (CpuHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Additional Inherited Members

- Public Types inherited from Os::CpuInterface
using Status = Os::Generic::Status
 
using Ticks = Os::Generic::UsedTotal
 

Detailed Description

cpu implementation

Definition at line 60 of file Cpu.hpp.

Constructor & Destructor Documentation

◆ Cpu() [1/3]

Os::Cpu::Cpu ( )

default constructor

Definition at line 10 of file Cpu.cpp.

◆ ~Cpu()

Os::Cpu::~Cpu ( )
final

default virtual destructor

Definition at line 12 of file Cpu.cpp.

◆ Cpu() [2/3]

Os::Cpu::Cpu ( const CpuInterface other)
delete

copy constructor is forbidden

◆ Cpu() [3/3]

Os::Cpu::Cpu ( const CpuInterface other)
delete

copy constructor is forbidden

Member Function Documentation

◆ _getCount()

Cpu::Status Os::Cpu::_getCount ( FwSizeType cpu_count)
overridevirtual

Request the count of the CPUs detected by the system.

This method wraps delegates to the underlying implementation.

Parameters
cpu_count(output) filled with CPU count on system
Returns
: OP_OK with valid CPU count, ERROR when error occurs

Implements Os::CpuInterface.

Definition at line 25 of file Cpu.cpp.

◆ _getTicks()

Cpu::Status Os::Cpu::_getTicks ( Ticks ticks,
FwSizeType  cpu_index 
)
overridevirtual

Get the CPU tick information for a given CPU.

CPU ticks represent a small time slice of processor time. This will retrieve the used CPU ticks and total ticks for a given CPU. This information in a running accumulation and thus a sample-to-sample differencing is needed to see the 'realtime' changing load. This shall be done by the caller. This method wraps delegates to the underlying implementation.

Parameters
ticks(output) filled with the tick information for the given CPU
cpu_indexindex for CPU to read. Default: 0
Returns
: ERROR when error occurs, OK otherwise.

Implements Os::CpuInterface.

Definition at line 30 of file Cpu.cpp.

◆ getCount()

Cpu::Status Os::Cpu::getCount ( FwSizeType cpu_count)
static

Request the count of the CPUs detected by the system.

This method wraps a singleton implementation.

Parameters
cpu_count(output) filled with CPU count on system
Returns
: OP_OK with valid CPU count, ERROR when error occurs

Definition at line 40 of file Cpu.cpp.

◆ getHandle()

CpuHandle * Os::Cpu::getHandle ( )
overridevirtual

return the underlying cpu handle (implementation specific).

Returns
internal task handle representation

Implements Os::CpuInterface.

Definition at line 35 of file Cpu.cpp.

◆ getSingleton()

Cpu & Os::Cpu::getSingleton ( )
static

return singleton

Definition at line 20 of file Cpu.cpp.

◆ getTicks()

Cpu::Status Os::Cpu::getTicks ( Ticks ticks,
FwSizeType  cpu_index 
)
static

Get the CPU tick information for a given CPU.

CPU ticks represent a small time slice of processor time. This will retrieve the used CPU ticks and total ticks for a given CPU. This information in a running accumulation and thus a sample-to-sample differencing is needed to see the 'realtime' changing load. This shall be done by the caller. This method wraps a singleton implementation.

Parameters
ticks(output) filled with the tick information for the given CPU
cpu_indexindex for CPU to read. Default: 0
Returns
: ERROR when error occurs, OK otherwise.

Definition at line 44 of file Cpu.cpp.

◆ init()

void Os::Cpu::init ( )
static

initialize the singleton

Definition at line 16 of file Cpu.cpp.

◆ operator=()

CpuInterface& Os::Cpu::operator= ( const CpuInterface other)
overridevirtualdelete

assignment operator is forbidden

Reimplemented from Os::CpuInterface.


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