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

Link-time delegating Mutex implementation. More...

#include <Os/DelegateMutex.hpp>

Inheritance diagram for Os::DelegateMutex:
Os::MutexInterface

Public Member Functions

 DelegateMutex ()
 Constructor. Mutex is unlocked when created. More...
 
 ~DelegateMutex () final
 Destructor. More...
 
 DelegateMutex (const DelegateMutex &other)=delete
 copy constructor is forbidden More...
 
DelegateMutex & operator= (const DelegateMutex &other)=delete
 assignment operator is forbidden More...
 
MutexHandle * getHandle () override
 return the underlying mutex handle (implementation specific) More...
 
Status take () override
 lock the mutex and get return status More...
 
Status release () override
 unlock the mutex and get return status More...
 
- Public Member Functions inherited from Os::MutexInterface
 MutexInterface ()=default
 default constructor More...
 
virtual ~MutexInterface ()=default
 default virtual destructor More...
 
 MutexInterface (const MutexInterface &other)=delete
 copy constructor is forbidden More...
 
 MutexInterface (const MutexInterface *other)=delete
 copy constructor is forbidden More...
 
MutexInterface & operator= (const MutexInterface &other)=delete
 assignment operator is forbidden More...
 
void lock ()
 lock the mutex and assert success More...
 
void unLock ()
 unlock the mutex and assert success More...
 
void unlock ()
 alias for unLock to meet BasicLockable requirements More...
 

Additional Inherited Members

- Public Types inherited from Os::MutexInterface
enum  Status {
  OP_OK, ERROR_BUSY, ERROR_DEADLOCK, NOT_SUPPORTED,
  ERROR_OTHER
}
 
- Static Public Member Functions inherited from Os::MutexInterface
static MutexInterface * getDelegate (MutexHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

Link-time delegating Mutex implementation.

Stores an implementation-defined mutex handle in a byte array and forwards all operations to a delegate constructed (via placement-new) by MutexInterface::getDelegate(). Which getDelegate() is linked selects the concrete implementation at link time. This is the default binding of the Os::Mutex alias; platforms may instead alias Os::Mutex directly to a concrete implementation for compile-time selection (see config/OsDelegateMutex.hpp).

Definition at line 19 of file DelegateMutex.hpp.

Constructor & Destructor Documentation

◆ DelegateMutex() [1/2]

Os::DelegateMutex::DelegateMutex ( )

Constructor. Mutex is unlocked when created.

Definition at line 14 of file DelegateMutex.cpp.

◆ ~DelegateMutex()

Os::DelegateMutex::~DelegateMutex ( )
final

Destructor.

Definition at line 19 of file DelegateMutex.cpp.

◆ DelegateMutex() [2/2]

Os::DelegateMutex::DelegateMutex ( const DelegateMutex &  other)
delete

copy constructor is forbidden

Member Function Documentation

◆ getHandle()

MutexHandle * Os::DelegateMutex::getHandle ( )
overridevirtual

return the underlying mutex handle (implementation specific)

Returns
internal mutex handle representation

Implements Os::MutexInterface.

Definition at line 24 of file DelegateMutex.cpp.

◆ operator=()

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

assignment operator is forbidden

◆ release()

DelegateMutex::Status Os::DelegateMutex::release ( )
overridevirtual

unlock the mutex and get return status

Implements Os::MutexInterface.

Definition at line 34 of file DelegateMutex.cpp.

◆ take()

DelegateMutex::Status Os::DelegateMutex::take ( )
overridevirtual

lock the mutex and get return status

Implements Os::MutexInterface.

Definition at line 29 of file DelegateMutex.cpp.


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