| 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 |
1/1✓ Branch 10 taken 11 times.
|
11 | Cpu::Cpu() : m_delegate(*CpuInterface::getDelegate(m_handle_storage)) {} |
| 11 | |||
| 12 | 24 | Cpu::~Cpu() { | |
| 13 | 22 | m_delegate.~CpuInterface(); | |
| 14 | 24 | } | |
| 15 | |||
| 16 | 3 | void Cpu::init() { | |
| 17 | 3 | (void)Cpu::getSingleton(); | |
| 18 | 3 | } | |
| 19 | |||
| 20 | 25 | Cpu& Cpu::getSingleton() { | |
| 21 |
4/7✓ Branch 0 taken 7 times.
✓ Branch 1 taken 18 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 7 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
|
25 | static Cpu _singleton; |
| 22 | 25 | return _singleton; | |
| 23 | } | ||
| 24 | |||
| 25 | 8 | Cpu::Status Cpu::_getCount(FwSizeType& cpu_count) { | |
| 26 | 8 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CpuInterface*>(&this->m_handle_storage[0])); | |
| 27 | 8 | return this->m_delegate._getCount(cpu_count); | |
| 28 | } | ||
| 29 | |||
| 30 | 13 | Cpu::Status Cpu::_getTicks(Ticks& ticks, FwSizeType cpu_index) { | |
| 31 | 13 | FW_ASSERT(&this->m_delegate == reinterpret_cast<CpuInterface*>(&this->m_handle_storage[0])); | |
| 32 | 13 | 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 | 8 | Cpu::Status Cpu::getCount(FwSizeType& cpu_count) { | |
| 41 | 8 | return Cpu::getSingleton()._getCount(cpu_count); | |
| 42 | } | ||
| 43 | |||
| 44 | 13 | Cpu::Status Cpu::getTicks(Ticks& ticks, FwSizeType cpu_index) { | |
| 45 | 13 | return Cpu::getSingleton()._getTicks(ticks, cpu_index); | |
| 46 | } | ||
| 47 | } // namespace Os | ||
| 48 |