| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // ====================================================================== | ||
| 2 | // \title Os/Cpu.hpp | ||
| 3 | // \brief common function implementations for Os::Cpu | ||
| 4 | // ====================================================================== | ||
| 5 | #include "Os/Cpu.hpp" | ||
| 6 | #include "Fw/Types/Assert.hpp" | ||
| 7 | |||
| 8 | namespace Os { | ||
| 9 | |||
| 10 | ✗ | Cpu::Cpu() : m_delegate(*CpuInterface::getDelegate(m_handle_storage)) {} | |
| 11 | |||
| 12 | ✗ | Cpu::~Cpu() { | |
| 13 | ✗ | m_delegate.~CpuInterface(); | |
| 14 | ✗ | } | |
| 15 | |||
| 16 | ✗ | void Cpu::init() { | |
| 17 | ✗ | (void)Cpu::getSingleton(); | |
| 18 | ✗ | } | |
| 19 | |||
| 20 | ✗ | Cpu& Cpu::getSingleton() { | |
| 21 | ✗ | static Cpu _singleton; | |
| 22 | ✗ | return _singleton; | |
| 23 | } | ||
| 24 | |||
| 25 | ✗ | Cpu::Status Cpu::_getCount(FwSizeType& cpu_count) { | |
| 26 | ✗ | FW_ASSERT(&this->m_delegate == reinterpret_cast<CpuInterface*>(&this->m_handle_storage[0])); | |
| 27 | ✗ | return this->m_delegate._getCount(cpu_count); | |
| 28 | } | ||
| 29 | |||
| 30 | ✗ | Cpu::Status Cpu::_getTicks(Ticks& ticks, FwSizeType cpu_index) { | |
| 31 | ✗ | FW_ASSERT(&this->m_delegate == reinterpret_cast<CpuInterface*>(&this->m_handle_storage[0])); | |
| 32 | ✗ | return this->m_delegate._getTicks(ticks, cpu_index); | |
| 33 | } | ||
| 34 | |||
| 35 | ✗ | CpuHandle* Cpu::getHandle() { | |
| 36 | ✗ | FW_ASSERT(&this->m_delegate == reinterpret_cast<CpuInterface*>(&this->m_handle_storage[0])); | |
| 37 | ✗ | return this->m_delegate.getHandle(); | |
| 38 | } | ||
| 39 | |||
| 40 | ✗ | Cpu::Status Cpu::getCount(FwSizeType& cpu_count) { | |
| 41 | ✗ | return Cpu::getSingleton()._getCount(cpu_count); | |
| 42 | } | ||
| 43 | |||
| 44 | ✗ | Cpu::Status Cpu::getTicks(Ticks& ticks, FwSizeType cpu_index) { | |
| 45 | ✗ | return Cpu::getSingleton()._getTicks(ticks, cpu_index); | |
| 46 | } | ||
| 47 | } // namespace Os | ||
| 48 |