STE-Industries: utilities testing
GraphicSpace::Mutex Class Reference

#include "Mutex.h"

Collaboration diagram for GraphicSpace::Mutex:
Collaboration graph

Public Member Functions

 Mutex (const Mutex &thisThread)=delete
 
 Mutex (Mutex &&thisMutex)=delete
 
 Mutex (void) noexcept
 
 ~Mutex (void) noexcept(false)
 
void Finalize (void) noexcept(false)
 
void Initialize (void) noexcept(false)
 
void Lock (void) noexcept(false)
 
Mutexoperator= (const Mutex &thisMutex)=delete
 
Mutexoperator= (Mutex &&thisMutex)=delete
 
void Unlock (void) noexcept(false)
 

Private Attributes

bool Active
 
pthread_mutex_t MutexData
 

Static Private Attributes

static constexpr unsigned int MUTEX_DESTROY_OK = 0
 
static constexpr unsigned int MUTEX_INIT_OK = 0
 
static constexpr unsigned int MUTEX_LOCK_OK = 0
 
static constexpr unsigned int MUTEX_UNLOCK_OK = 0
 

Detailed Description

The Mutex class represents a mutex region.

Definition at line 28 of file Mutex.h.

Constructor & Destructor Documentation

◆ Mutex() [1/3]

GraphicSpace::Mutex::Mutex ( void  )
noexcept
Description:
Constructor.
Exceptions
None.
Returns
Not applicable.

Definition at line 31 of file Mutex.cpp.

◆ Mutex() [2/3]

GraphicSpace::Mutex::Mutex ( const Mutex thisThread)
delete

◆ Mutex() [3/3]

GraphicSpace::Mutex::Mutex ( Mutex &&  thisMutex)
delete

◆ ~Mutex()

GraphicSpace::Mutex::~Mutex ( void  )
noexcept
Description:
Destructor.
Exceptions
SystemExceptionType::MUTEX_DESTROY_FAILEDIf the destruction fails.
Returns
Not applicable.

Definition at line 46 of file Mutex.cpp.

Member Function Documentation

◆ Finalize()

void GraphicSpace::Mutex::Finalize ( void  )
noexcept
Description:
Destroy the Mutex.
Exceptions
SystemExceptionType::INVALID_MUTEX_OPERATIONIf the Mutex is not initialized.
SystemExceptionType::MUTEX_DESTROY_FAILEDIf the operation fails.
Returns
Not applicable.
See also
MUTEX_DESTROY_OK

Definition at line 93 of file Mutex.cpp.

References GraphicSpace::INVALID_MUTEX_OPERATION, and GraphicSpace::MUTEX_DESTROY_FAILED.

◆ Initialize()

void GraphicSpace::Mutex::Initialize ( void  )
noexcept
Description:
Initialize the mutex.
Exceptions
SystemExceptionType::INVALID_MUTEX_OPERATIONIf the Mutex is already initialized.
SystemExceptionType::MUTEX_INITIALIZATION_FAILEDIf the initialization fails.
Returns
Not applicable.
See also
MUTEX_INIT_OK

Definition at line 67 of file Mutex.cpp.

References GraphicSpace::INVALID_MUTEX_OPERATION, and GraphicSpace::MUTEX_INITIALIZATION_FAILED.

◆ Lock()

void GraphicSpace::Mutex::Lock ( void  )
noexcept
Description:
Lock the mutex.
Exceptions
SystemExceptionType::INVALID_MUTEX_OPERATIONIf the Mutex is not initialized.
SystemExceptionType::MUTEX_LOCK_FAILEDIf the operation fails.
Returns
None.
See also
MUTEX_LOCK_OK

Definition at line 118 of file Mutex.cpp.

References GraphicSpace::INVALID_MUTEX_OPERATION, and GraphicSpace::MUTEX_LOCK_FAILED.

◆ operator=() [1/2]

Mutex& GraphicSpace::Mutex::operator= ( const Mutex thisMutex)
delete

◆ operator=() [2/2]

Mutex& GraphicSpace::Mutex::operator= ( Mutex &&  thisMutex)
delete

◆ Unlock()

void GraphicSpace::Mutex::Unlock ( void  )
noexcept
Description:
Unlock the mutex.
Exceptions
SystemExceptionType::INVALID_MUTEX_OPERATIONIf the Mutex is not initialized.
SystemExceptionType::MUTEX_UNLOCK_FAILEDIf the operation fails.
Returns
None.
See also
MUTEX_UNLOCK_OK

Definition at line 142 of file Mutex.cpp.

References GraphicSpace::INVALID_MUTEX_OPERATION, and GraphicSpace::MUTEX_UNLOCK_FAILED.

Member Data Documentation

◆ Active

GraphicSpace::Mutex::Active
private

Flag indicating whether the Mutex is initialized.

Definition at line 50 of file Mutex.h.

◆ MUTEX_DESTROY_OK

GraphicSpace::Mutex::MUTEX_DESTROY_OK = 0
staticconstexprprivate

Value returned by pthread_mutex_destroy when the operation succeeds.

Definition at line 38 of file Mutex.h.

◆ MUTEX_INIT_OK

GraphicSpace::Mutex::MUTEX_INIT_OK = 0
staticconstexprprivate

Value returned by pthread_mutex_init when the operation succeeds.

Definition at line 34 of file Mutex.h.

◆ MUTEX_LOCK_OK

GraphicSpace::Mutex::MUTEX_LOCK_OK = 0
staticconstexprprivate

Value returned by pthread_mutex_lock when the operation succeeds.

Definition at line 42 of file Mutex.h.

◆ MUTEX_UNLOCK_OK

GraphicSpace::Mutex::MUTEX_UNLOCK_OK = 0
staticconstexprprivate

Value returned by pthread_mutex_unlock when the operation succeeds.

Definition at line 46 of file Mutex.h.

◆ MutexData

GraphicSpace::Mutex::MutexData
private

Mutex data.

Definition at line 54 of file Mutex.h.


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