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

interface for cpu implementation More...

#include <Os/Cpu.hpp>

Inheritance diagram for Os::CpuInterface:
Os::Cpu Os::Darwin::Cpu::DarwinCpu Os::Linux::Cpu::LinuxCpu Os::Stub::Cpu::StubCpu

Public Types

using Status = Os::Generic::Status
 
using Ticks = Os::Generic::UsedTotal
 

Public Member Functions

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

Static Public Member Functions

static CpuInterfacegetDelegate (CpuHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

interface for cpu implementation

Definition at line 16 of file Cpu.hpp.

Member Typedef Documentation

◆ Status

Definition at line 18 of file Cpu.hpp.

◆ Ticks

Definition at line 19 of file Cpu.hpp.

Constructor & Destructor Documentation

◆ CpuInterface() [1/2]

Os::CpuInterface::CpuInterface ( )
default

Default constructor.

◆ ~CpuInterface()

virtual Os::CpuInterface::~CpuInterface ( )
virtualdefault

Default destructor.

◆ CpuInterface() [2/2]

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

copy constructor is forbidden

Member Function Documentation

◆ _getCount()

virtual Status Os::CpuInterface::_getCount ( FwSizeType cpu_count)
pure virtual

Request the count of the CPUs detected by the system.

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

Implemented in Os::Stub::Cpu::StubCpu, Os::Linux::Cpu::LinuxCpu, Os::Darwin::Cpu::DarwinCpu, and Os::Cpu.

◆ _getTicks()

virtual Status Os::CpuInterface::_getTicks ( Ticks ticks,
FwSizeType  cpu_index 
)
pure virtual

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.

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.

Implemented in Os::Stub::Cpu::StubCpu, Os::Cpu, Os::Linux::Cpu::LinuxCpu, and Os::Darwin::Cpu::DarwinCpu.

◆ getDelegate()

CpuInterface * Os::CpuInterface::getDelegate ( CpuHandleStorage aligned_new_memory)
static

provide a pointer to a Mutex delegate object

Definition at line 10 of file DefaultCpu.cpp.

◆ getHandle()

virtual CpuHandle* Os::CpuInterface::getHandle ( )
pure virtual

return the underlying cpu handle (implementation specific).

Returns
internal task handle representation

Implemented in Os::Stub::Cpu::StubCpu, Os::Linux::Cpu::LinuxCpu, Os::Darwin::Cpu::DarwinCpu, and Os::Cpu.

◆ operator=()

virtual CpuInterface& Os::CpuInterface::operator= ( const CpuInterface other)
virtualdelete

assignment operator is forbidden

Reimplemented in Os::Stub::Cpu::StubCpu, Os::Linux::Cpu::LinuxCpu, Os::Darwin::Cpu::DarwinCpu, and Os::Cpu.


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