F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Os::CountingSemaphore Class Referencefinal

#include <Os/CountingSemaphore.hpp>

Inheritance diagram for Os::CountingSemaphore:
Os::CountingSemaphoreInterface

Public Member Functions

 CountingSemaphore (U32 initial_count)
 Constructor with initial count. More...
 
 ~CountingSemaphore () final
 Destructor. More...
 
 CountingSemaphore (const CountingSemaphoreInterface &other)=delete
 
 CountingSemaphore (const CountingSemaphore &other)=delete
 
CountingSemaphoreoperator= (const CountingSemaphore &other)=delete
 
 CountingSemaphore (CountingSemaphore &&other)=delete
 
CountingSemaphoreoperator= (CountingSemaphore &&other)=delete
 
Status wait () override
 wait (decrement), blocking if count is zero More...
 
Status waitTimeout (const Fw::TimeInterval &interval) override
 wait with timeout More...
 
Status tryWait () override
 non-blocking attempt to decrement the semaphore More...
 
Status post () override
 post (increment) the semaphore, potentially waking a waiting thread More...
 
CountingSemaphoreHandlegetHandle () override
 return the underlying semaphore handle (implementation specific) More...
 
- Public Member Functions inherited from Os::CountingSemaphoreInterface
 CountingSemaphoreInterface ()=default
 default constructor More...
 
virtual ~CountingSemaphoreInterface ()=default
 default virtual destructor More...
 
 CountingSemaphoreInterface (const CountingSemaphoreInterface &other)=delete
 copy constructor is forbidden More...
 
CountingSemaphoreInterfaceoperator= (const CountingSemaphoreInterface &other)=delete
 assignment operator is forbidden More...
 

Additional Inherited Members

- Public Types inherited from Os::CountingSemaphoreInterface
enum  Status {
  OP_OK, ERROR_TIMEOUT, ERROR_INVALID, ERROR_NOT_IMPLEMENTED,
  NOT_SUPPORTED, ERROR_OTHER
}
 
- Static Public Member Functions inherited from Os::CountingSemaphoreInterface
static CountingSemaphoreInterfacegetDelegate (CountingSemaphoreHandleStorage &aligned_new_memory, U32 initial_count)
 provide a pointer to a CountingSemaphore delegate object More...
 

Detailed Description

Definition at line 63 of file CountingSemaphore.hpp.

Constructor & Destructor Documentation

◆ CountingSemaphore() [1/4]

Os::CountingSemaphore::CountingSemaphore ( U32  initial_count)
explicit

Constructor with initial count.

Definition at line 5 of file CountingSemaphore.cpp.

◆ ~CountingSemaphore()

Os::CountingSemaphore::~CountingSemaphore ( )
final

Destructor.

Definition at line 8 of file CountingSemaphore.cpp.

◆ CountingSemaphore() [2/4]

Os::CountingSemaphore::CountingSemaphore ( const CountingSemaphoreInterface other)
delete

◆ CountingSemaphore() [3/4]

Os::CountingSemaphore::CountingSemaphore ( const CountingSemaphore other)
delete

◆ CountingSemaphore() [4/4]

Os::CountingSemaphore::CountingSemaphore ( CountingSemaphore &&  other)
delete

Member Function Documentation

◆ getHandle()

CountingSemaphoreHandle * Os::CountingSemaphore::getHandle ( )
overridevirtual

return the underlying semaphore handle (implementation specific)

Returns
internal semaphore handle representation

Implements Os::CountingSemaphoreInterface.

Definition at line 32 of file CountingSemaphore.cpp.

◆ operator=() [1/2]

CountingSemaphore& Os::CountingSemaphore::operator= ( const CountingSemaphore other)
delete

◆ operator=() [2/2]

CountingSemaphore& Os::CountingSemaphore::operator= ( CountingSemaphore &&  other)
delete

◆ post()

CountingSemaphore::Status Os::CountingSemaphore::post ( )
overridevirtual

post (increment) the semaphore, potentially waking a waiting thread

Returns
status of the operation

Implements Os::CountingSemaphoreInterface.

Definition at line 27 of file CountingSemaphore.cpp.

◆ tryWait()

CountingSemaphore::Status Os::CountingSemaphore::tryWait ( )
overridevirtual

non-blocking attempt to decrement the semaphore

Returns
OP_OK if decremented, ERROR_TIMEOUT if count was zero

Implements Os::CountingSemaphoreInterface.

Definition at line 22 of file CountingSemaphore.cpp.

◆ wait()

CountingSemaphore::Status Os::CountingSemaphore::wait ( )
overridevirtual

wait (decrement), blocking if count is zero

Implements Os::CountingSemaphoreInterface.

Definition at line 12 of file CountingSemaphore.cpp.

◆ waitTimeout()

CountingSemaphore::Status Os::CountingSemaphore::waitTimeout ( const Fw::TimeInterval interval)
overridevirtual

wait with timeout

Implements Os::CountingSemaphoreInterface.

Definition at line 17 of file CountingSemaphore.cpp.


The documentation for this class was generated from the following files: