SignalSemaphore class for managing a named semaphore.
More...
#include <SignalSemaphore.h>
|
| static constexpr uint32_t | MaxNameLength = 39U |
| | Maximum length of the semaphore name (excluding null terminator).
|
| |
SignalSemaphore class for managing a named semaphore.
◆ SignalSemaphore() [1/2]
| SignalSemaphore::SignalSemaphore |
( |
const char * |
baseName, |
|
|
const char * |
nameExtension = nullptr |
|
) |
| |
|
noexcept |
Constructor for SignalSemaphore.
- Parameters
-
| baseName | Base name of the semaphore. |
| nameExtension | Optional name extension for uniqueness. |
- Todo:
- Add
- Copyright
- line once project copyright wording is finalised.
- Example
int main() {
} else {
}
return 0;
}
SignalSemaphore class definition.
SignalSemaphore class for managing a named semaphore.
Definition SignalSemaphore.h:21
OS_Semaphore semaphore
The semaphore object.
Definition SignalSemaphore.h:86
- Parameters
-
| baseName | Base name of the semaphore. |
| nameExtension | Optional name extension for uniqueness. |
◆ SignalSemaphore() [2/2]
Deleted copy constructor to avoid copying instances.
◆ ~SignalSemaphore()
| SignalSemaphore::~SignalSemaphore |
( |
| ) |
|
◆ EnsureInitialized()
| bool SignalSemaphore::EnsureInitialized |
( |
| ) |
|
|
noexcept |
Ensures the semaphore is initialized.
- Returns
- True if the semaphore is initialized, false otherwise.
◆ GetName()
| const char * SignalSemaphore::GetName |
( |
| ) |
const |
|
noexcept |
Gets the name of the semaphore.
- Returns
- The name of the semaphore.
◆ IsInitialized()
| bool SignalSemaphore::IsInitialized |
( |
| ) |
const |
|
noexcept |
Checks if the semaphore is initialized.
- Returns
- True if the semaphore is initialized, false otherwise.
◆ IsSignalled()
| bool SignalSemaphore::IsSignalled |
( |
| ) |
|
|
noexcept |
Checks if the semaphore is signaled.
- Returns
- True if the semaphore is signaled, false otherwise.
◆ operator=()
Deleted assignment operator to avoid copying instances.
◆ Signal()
| bool SignalSemaphore::Signal |
( |
| ) |
|
|
noexcept |
Signals the semaphore.
- Returns
- True if the semaphore was successfully signaled, false otherwise.
◆ WaitUntilSignalled()
| bool SignalSemaphore::WaitUntilSignalled |
( |
uint32_t |
msecToWait = OS_WAIT_FOREVER | ) |
|
|
noexcept |
Waits until the semaphore is signaled.
- Parameters
-
| msecToWait | Maximum time to wait in milliseconds. |
- Returns
- True if the semaphore was successfully acquired, false otherwise.
◆ initialized
| bool SignalSemaphore::initialized |
|
private |
Indicates whether the semaphore is initialized.
◆ MaxNameLength
| constexpr uint32_t SignalSemaphore::MaxNameLength = 39U |
|
staticconstexprprivate |
Maximum length of the semaphore name (excluding null terminator).
◆ name
The name of the semaphore.
◆ semaphore
The documentation for this class was generated from the following files: