GCC Code Coverage Report


Directory: Os/
File: CountingSemaphore.cpp
Date: 2026-09-03 21:15:10
Exec Total Coverage
Lines: 0 20 0.0%
Functions: 0 7 0.0%
Branches: 0 1 0.0%

Line Branch Exec Source
1 #include "Os/CountingSemaphore.hpp"
2 #include "Fw/Types/Assert.hpp"
3
4 namespace Os {
5 CountingSemaphore::CountingSemaphore(U32 initial_count)
6 : m_delegate(*CountingSemaphoreInterface::getDelegate(m_handle_storage, initial_count)) {}
7
8 CountingSemaphore::~CountingSemaphore() {
9 m_delegate.~CountingSemaphoreInterface();
10 }
11
12 CountingSemaphore::Status CountingSemaphore::wait() {
13 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
14 return this->m_delegate.wait();
15 }
16
17 CountingSemaphore::Status CountingSemaphore::waitTimeout(const Fw::TimeInterval& interval) {
18 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
19 return this->m_delegate.waitTimeout(interval);
20 }
21
22 CountingSemaphore::Status CountingSemaphore::tryWait() {
23 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
24 return this->m_delegate.tryWait();
25 }
26
27 CountingSemaphore::Status CountingSemaphore::post() {
28 FW_ASSERT(&this->m_delegate == reinterpret_cast<CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
29 return this->m_delegate.post();
30 }
31
32 CountingSemaphoreHandle* CountingSemaphore::getHandle() {
33 FW_ASSERT(&this->m_delegate == reinterpret_cast<const CountingSemaphoreInterface*>(&this->m_handle_storage[0]));
34 return this->m_delegate.getHandle();
35 }
36
37 } // namespace Os
38