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/Darwin/Cpu.hpp
3 // \brief Darwin implementation for Os::Cpu, header and test definitions
4 // ======================================================================
5 #include <Os/Cpu.hpp>
6 #ifndef OS_Darwin_Cpu_HPP
7 #define OS_Darwin_Cpu_HPP
8 
9 namespace Os {
10 namespace Darwin {
11 namespace Cpu {
12 
15 struct DarwinCpuHandle : public CpuHandle {};
16 
21 class DarwinCpu : public CpuInterface {
22  public:
25  DarwinCpu() = default;
26 
28  DarwinCpu(const DarwinCpu& other) = delete;
29 
31  CpuInterface& operator=(const CpuInterface& other) override = delete;
32 
35  ~DarwinCpu() override = default;
36 
37  // ------------------------------------
38  // Functions overrides
39  // ------------------------------------
40  public:
48  Status _getCount(FwSizeType& cpu_count) override;
49 
61  Status _getTicks(Os::Cpu::Ticks& ticks, FwSizeType cpu_index) override;
62 
70  CpuHandle* getHandle() override;
71 
72  private:
74  DarwinCpuHandle m_handle;
75 };
76 } // namespace Cpu
77 } // namespace Darwin
78 } // namespace Os
79 
80 #endif // OS_Darwin_Cpu_HPP
stub implementation of Os::CpuInterface
Definition: Cpu.hpp:21
PlatformSizeType FwSizeType
Cpu variable handle parent.
Definition: Cpu.hpp:13
Status _getTicks(Os::Cpu::Ticks &ticks, FwSizeType cpu_index) override
Get the CPU tick information for a given CPU.
Definition: Cpu.cpp:78
Status _getCount(FwSizeType &cpu_count) override
Request the count of the CPUs detected by the system.
Definition: Cpu.cpp:69
CpuHandle * getHandle() override
returns the raw console handle
Definition: Cpu.cpp:88
Status
Generic OK/ERROR status.
Definition: Os.hpp:25
DarwinCpu()=default
constructor
CpuInterface & operator=(const CpuInterface &other) override=delete
default copy assignment
Generic used/total struct.
Definition: Os.hpp:31
~DarwinCpu() override=default
destructor
interface for cpu implementation
Definition: Cpu.hpp:16