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

stub implementation of Os::CpuInterface More...

#include <Os/Stub/Cpu.hpp>

Inheritance diagram for Os::Stub::Cpu::StubCpu:
Os::CpuInterface

Public Member Functions

 StubCpu ()=default
 constructor More...
 
 StubCpu (const StubCpu &other)=delete
 copy constructor More...
 
CpuInterfaceoperator= (const CpuInterface &other) override=delete
 default copy assignment More...
 
 ~StubCpu () override=default
 destructor 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
 returns the raw console handle 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...
 

Additional Inherited Members

- Public Types inherited from Os::CpuInterface
using Status = Os::Generic::Status
 
using Ticks = Os::Generic::UsedTotal
 
- Static Public Member Functions inherited from Os::CpuInterface
static CpuInterfacegetDelegate (CpuHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

stub implementation of Os::CpuInterface

Stub implementation of CpuInterface for use as a delegate class handling stub console operations.

Definition at line 23 of file Cpu.hpp.

Constructor & Destructor Documentation

◆ StubCpu() [1/2]

Os::Stub::Cpu::StubCpu::StubCpu ( )
default

constructor

◆ StubCpu() [2/2]

Os::Stub::Cpu::StubCpu::StubCpu ( const StubCpu other)
delete

copy constructor

◆ ~StubCpu()

Os::Stub::Cpu::StubCpu::~StubCpu ( )
overridedefault

destructor

Member Function Documentation

◆ _getCount()

CpuInterface::Status Os::Stub::Cpu::StubCpu::_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 11 of file Cpu.cpp.

◆ _getTicks()

CpuInterface::Status Os::Stub::Cpu::StubCpu::_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 16 of file Cpu.cpp.

◆ getHandle()

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

returns the raw console handle

Gets the raw console handle from the implementation. Note: users must include the implementation specific header to make any real use of this handle. Otherwise it will be as an opaque type.

Returns
raw console handle

Implements Os::CpuInterface.

Definition at line 22 of file Cpu.cpp.

◆ operator=()

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

default copy assignment

Reimplemented from Os::CpuInterface.


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