F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Loading...
Searching...
No Matches
Cpu.hpp
Go to the documentation of this file.
1// ======================================================================
2// \title Os/Stub/Cpu.hpp
3// \brief stub implementation for Os::Cpu, header and test definitions
4// ======================================================================
5#include <cstdio>
6#include <Os/Cpu.hpp>
7#ifndef OS_Stub_Cpu_HPP
8#define OS_Stub_Cpu_HPP
9
10namespace Os {
11namespace Stub {
12namespace Cpu {
13
16struct StubCpuHandle : public CpuHandle {
17};
18
23class StubCpu : public CpuInterface {
24 public:
27 StubCpu() = default;
28
30 StubCpu(const StubCpu& other) = delete;
31
33 CpuInterface& operator=(const CpuInterface& other) override = delete;
34
37 ~StubCpu() override = default;
38
39 // ------------------------------------
40 // Functions overrides
41 // ------------------------------------
42 public:
43
51 Status _getCount(FwSizeType& cpu_count) override;
52
64 Status _getTicks(Ticks& ticks, FwSizeType cpu_index) override;
65
73 CpuHandle *getHandle() override;
74 private:
76 StubCpuHandle m_handle;
77};
78} // namespace Cpu
79} // namespace Stub
80} // namespace Os
81
82#endif // OS_Stub_Cpu_HPP
PlatformSizeType FwSizeType
Definition FpConfig.h:35
Cpu variable handle parent.
Definition Cpu.hpp:13
interface for cpu implementation
Definition Cpu.hpp:16
stub implementation of Os::CpuInterface
Definition Cpu.hpp:23
StubCpu(const StubCpu &other)=delete
copy constructor
Status _getCount(FwSizeType &cpu_count) override
Request the count of the CPUs detected by the system.
Definition Cpu.cpp:11
CpuInterface & operator=(const CpuInterface &other) override=delete
default copy assignment
Status _getTicks(Ticks &ticks, FwSizeType cpu_index) override
Get the CPU tick information for a given CPU.
Definition Cpu.cpp:16
StubCpu()=default
constructor
CpuHandle * getHandle() override
returns the raw console handle
Definition Cpu.cpp:22
~StubCpu() override=default
destructor
Status
Generic OK/ERROR status.
Definition Os.hpp:25
Generic used/total struct.
Definition Os.hpp:31