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

#include <Os/Mutex.hpp>

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

Public Types

enum  Status { OP_OK , ERROR_BUSY , ERROR_DEADLOCK , 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...
 
MutexInterfaceoperator= (const MutexInterface &other)=delete
 assignment operator is forbidden More...
 
virtual MutexHandlegetHandle ()=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...
 

Static Public Member Functions

static MutexInterfacegetDelegate (MutexHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

Definition at line 15 of file Mutex.hpp.

Member Enumeration Documentation

◆ Status

Enumerator
OP_OK 

Operation was successful.

ERROR_BUSY 

Mutex is busy.

ERROR_DEADLOCK 

Deadlock condition detected.

ERROR_OTHER 

All other errors.

Definition at line 17 of file Mutex.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::Mutex.

◆ 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::Mutex.

◆ 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::Mutex.


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