![]() |
F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
|
#include <Os/CountingSemaphore.hpp>
Public Types | |
| enum | Status { OP_OK, ERROR_TIMEOUT, ERROR_INVALID, ERROR_NOT_IMPLEMENTED, NOT_SUPPORTED, ERROR_OTHER } |
Public Member Functions | |
| CountingSemaphoreInterface ()=default | |
| default constructor More... | |
| virtual | ~CountingSemaphoreInterface ()=default |
| default virtual destructor More... | |
| CountingSemaphoreInterface (const CountingSemaphoreInterface &other)=delete | |
| copy constructor is forbidden More... | |
| CountingSemaphoreInterface & | operator= (const CountingSemaphoreInterface &other)=delete |
| assignment operator is forbidden More... | |
| virtual Status | wait ()=0 |
| wait (decrement) the semaphore, blocking if count is zero More... | |
| virtual Status | waitTimeout (const Fw::TimeInterval &interval)=0 |
| wait on the semaphore with a timeout More... | |
| virtual Status | tryWait ()=0 |
| non-blocking attempt to decrement the semaphore More... | |
| virtual Status | post ()=0 |
| post (increment) the semaphore, potentially waking a waiting thread More... | |
| virtual CountingSemaphoreHandle * | getHandle ()=0 |
| return the underlying semaphore handle (implementation specific) More... | |
Static Public Member Functions | |
| static CountingSemaphoreInterface * | getDelegate (CountingSemaphoreHandleStorage &aligned_new_memory, U32 initial_count) |
| provide a pointer to a CountingSemaphore delegate object More... | |
Definition at line 14 of file CountingSemaphore.hpp.
| Enumerator | |
|---|---|
| OP_OK | Operation was successful. |
| ERROR_TIMEOUT | Timeout occurred during wait. |
| ERROR_INVALID | Invalid semaphore or argument. |
| ERROR_NOT_IMPLEMENTED | Feature not implemented. |
| NOT_SUPPORTED | CountingSemaphore does not support operation. |
| ERROR_OTHER | All other errors. |
Definition at line 16 of file CountingSemaphore.hpp.
|
default |
default constructor
|
virtualdefault |
default virtual destructor
|
delete |
copy constructor is forbidden
|
static |
provide a pointer to a CountingSemaphore delegate object
Definition at line 10 of file DefaultCountingSemaphore.cpp.
|
pure virtual |
return the underlying semaphore handle (implementation specific)
Implemented in Os::CountingSemaphore, Os::Darwin::Semaphore::DarwinCountingSemaphore, Os::Posix::Semaphore::PosixCountingSemaphore, and Os::Stub::Semaphore::StubCountingSemaphore.
|
delete |
assignment operator is forbidden
|
pure virtual |
post (increment) the semaphore, potentially waking a waiting thread
Implemented in Os::CountingSemaphore, Os::Darwin::Semaphore::DarwinCountingSemaphore, Os::Posix::Semaphore::PosixCountingSemaphore, and Os::Stub::Semaphore::StubCountingSemaphore.
|
pure virtual |
non-blocking attempt to decrement the semaphore
Implemented in Os::CountingSemaphore, Os::Darwin::Semaphore::DarwinCountingSemaphore, Os::Posix::Semaphore::PosixCountingSemaphore, and Os::Stub::Semaphore::StubCountingSemaphore.
|
pure virtual |
wait (decrement) the semaphore, blocking if count is zero
Implemented in Os::CountingSemaphore, Os::Darwin::Semaphore::DarwinCountingSemaphore, Os::Posix::Semaphore::PosixCountingSemaphore, and Os::Stub::Semaphore::StubCountingSemaphore.
|
pure virtual |
wait on the semaphore with a timeout
| interval | maximum time to wait |
Implemented in Os::CountingSemaphore, Os::Darwin::Semaphore::DarwinCountingSemaphore, Os::Posix::Semaphore::PosixCountingSemaphore, and Os::Stub::Semaphore::StubCountingSemaphore.