F´ Flight Software - C/C++ Documentation  devel
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/Linux/Cpu.hpp
3 // \brief Linux implementation for Os::Cpu, header and test definitions
4 // ======================================================================
5 #include <Os/Cpu.hpp>
6 #include <Os/File.hpp>
7 #ifndef OS_Linux_Cpu_HPP
8 #define OS_Linux_Cpu_HPP
9 
10 namespace Os {
11 namespace Linux {
12 namespace Cpu {
13 
16 struct LinuxCpuHandle : public CpuHandle {};
17 
22 class LinuxCpu : public CpuInterface {
23  public:
26  LinuxCpu() = default;
27 
29  LinuxCpu(const LinuxCpu& other) = delete;
30 
32  CpuInterface& operator=(const CpuInterface& other) override = delete;
33 
36  ~LinuxCpu() override = default;
37 
38  // ------------------------------------
39  // Functions overrides
40  // ------------------------------------
41  public:
42 
50  Status _getCount(FwSizeType& cpu_count) override;
51 
63  Status _getTicks(Os::Cpu::Ticks& ticks, FwSizeType cpu_index) override;
64 
72  CpuHandle *getHandle() override;
73  private:
75  LinuxCpuHandle m_handle;
76 };
77 } // namespace Cpu
78 } // namespace Linux
79 } // namespace Os
80 
81 #endif // OS_Linux_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:22
CpuInterface & operator=(const CpuInterface &other) override=delete
default copy assignment
~LinuxCpu() override=default
destructor
Status _getCount(FwSizeType &cpu_count) override
Request the count of the CPUs detected by the system.
Definition: Cpu.cpp:79
LinuxCpu()=default
constructor
CpuHandle * getHandle() override
returns the raw console handle
Definition: Cpu.cpp:105
Status _getTicks(Os::Cpu::Ticks &ticks, FwSizeType cpu_index) override
Get the CPU tick information for a given CPU.
Definition: Cpu.cpp:89
LinuxCpu(const LinuxCpu &other)=delete
copy constructor
Status
Generic OK/ERROR status.
Definition: Os.hpp:25
Generic used/total struct.
Definition: Os.hpp:31