F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
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 <Os/Cpu.hpp>
6 #include <cstdio>
7 #ifndef OS_Stub_Cpu_HPP
8 #define OS_Stub_Cpu_HPP
9 
10 namespace Os {
11 namespace Stub {
12 namespace Cpu {
13 
16 struct StubCpuHandle : public CpuHandle {};
17 
22 class StubCpu : public CpuInterface {
23  public:
26  StubCpu() = default;
27 
29  StubCpu(const StubCpu& other) = delete;
30 
32  CpuInterface& operator=(const CpuInterface& other) override = delete;
33 
36  ~StubCpu() override = default;
37 
38  // ------------------------------------
39  // Functions overrides
40  // ------------------------------------
41  public:
49  Status _getCount(FwSizeType& cpu_count) override;
50 
62  Status _getTicks(Ticks& ticks, FwSizeType cpu_index) override;
63 
71  CpuHandle* getHandle() override;
72 
73  private:
75  StubCpuHandle m_handle;
76 };
77 } // namespace Cpu
78 } // namespace Stub
79 } // namespace Os
80 
81 #endif // OS_Stub_Cpu_HPP
StubCpu()=default
constructor
PlatformSizeType FwSizeType
Cpu variable handle parent.
Definition: Cpu.hpp:13
Status _getCount(FwSizeType &cpu_count) override
Request the count of the CPUs detected by the system.
Definition: Cpu.cpp:11
Status
Generic OK/ERROR status.
Definition: Os.hpp:25
stub implementation of Os::CpuInterface
Definition: Cpu.hpp:22
Generic used/total struct.
Definition: Os.hpp:31
~StubCpu() override=default
destructor
Status _getTicks(Ticks &ticks, FwSizeType cpu_index) override
Get the CPU tick information for a given CPU.
Definition: Cpu.cpp:16
CpuInterface & operator=(const CpuInterface &other) override=delete
default copy assignment
interface for cpu implementation
Definition: Cpu.hpp:16
CpuHandle * getHandle() override
returns the raw console handle
Definition: Cpu.cpp:22