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

#include <Os/MutexInterface.hpp>

Inheritance diagram for Os::MutexInterface:
Os::DelegateMutex Os::Posix::Mutex::PosixMutex Os::Stub::Mutex::StubMutex

Public Types

enum  Status {
  OP_OK, ERROR_BUSY, ERROR_DEADLOCK, NOT_SUPPORTED,
  ERROR_OTHER
}
 

Public Member Functions

 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...
 
virtual MutexHandle * getHandle ()=0
 return the underlying mutex handle (implementation specific) More...
 
virtual Status take ()=0
 lock the mutex return status More...
 
virtual Status release ()=0
 unlock the mutex return status 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...
 

Static Public Member Functions

static MutexInterface * getDelegate (MutexHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

Definition at line 17 of file MutexInterface.hpp.

Member Enumeration Documentation

◆ Status

Enumerator
OP_OK 

Operation was successful.

ERROR_BUSY 

Mutex is busy.

ERROR_DEADLOCK 

Deadlock condition detected.

NOT_SUPPORTED 

Mutex does not support operation.

ERROR_OTHER 

All other errors.

Definition at line 19 of file MutexInterface.hpp.

Constructor & Destructor Documentation

◆ MutexInterface() [1/3]

Os::MutexInterface::MutexInterface ( )
default

default constructor

◆ ~MutexInterface()

virtual Os::MutexInterface::~MutexInterface ( )
virtualdefault

default virtual destructor

◆ MutexInterface() [2/3]

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

copy constructor is forbidden

◆ MutexInterface() [3/3]

Os::MutexInterface::MutexInterface ( const MutexInterface *  other)
delete

copy constructor is forbidden

Member Function Documentation

◆ getDelegate()

MutexInterface * Os::MutexInterface::getDelegate ( MutexHandleStorage &  aligned_new_memory)
static

provide a pointer to a Mutex delegate object

get a delegate for MutexInterface that intercepts calls for stub file usage

get a delegate for MutexInterface that intercepts calls for Posix

Parameters
aligned_new_memoryaligned memory to fill
Returns
: pointer to delegate
Parameters
aligned_new_memoryaligned memory to fill
to_copypointer to copy-constructor input
Returns
: pointer to delegate

Definition at line 13 of file DefaultMutex.cpp.

◆ getHandle()

virtual MutexHandle* Os::MutexInterface::getHandle ( )
pure virtual

return the underlying mutex handle (implementation specific)

Returns
internal mutex handle representation

Implemented in Os::Stub::Mutex::StubMutex, Os::Posix::Mutex::PosixMutex, and Os::DelegateMutex.

◆ lock()

void Os::MutexInterface::lock ( )
inline

lock the mutex and assert success

Definition at line 65 of file MutexInterface.hpp.

◆ operator=()

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

assignment operator is forbidden

◆ release()

virtual Status Os::MutexInterface::release ( )
pure virtual

unlock the mutex return status

Implemented in Os::Stub::Mutex::StubMutex, Os::Posix::Mutex::PosixMutex, and Os::DelegateMutex.

◆ take()

virtual Status Os::MutexInterface::take ( )
pure virtual

lock the mutex return status

Implemented in Os::Stub::Mutex::StubMutex, Os::Posix::Mutex::PosixMutex, and Os::DelegateMutex.

◆ unLock()

void Os::MutexInterface::unLock ( )
inline

unlock the mutex and assert success

Definition at line 72 of file MutexInterface.hpp.

◆ unlock()

void Os::MutexInterface::unlock ( )
inline

alias for unLock to meet BasicLockable requirements

Definition at line 79 of file MutexInterface.hpp.


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