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

locks a mutex within the current scope More...

#include <Os/Mutex.hpp>

Public Member Functions

 ScopeLock (Mutex &mutex)
 construct the scope lock More...
 
 ~ScopeLock ()
 unlock the scoped mutex More...
 
 ScopeLock (const ScopeLock &other)=delete
 copy constructor is forbidden More...
 
 ScopeLock (const ScopeLock *other)=delete
 copy constructor is forbidden More...
 
ScopeLockoperator= (const ScopeLock &other)=delete
 assignment operator is forbidden More...
 

Detailed Description

locks a mutex within the current scope

The scope lock will lock the associated mutex immediately and will ensure the mutex is unlock when the scope lock is destroyed.

Warning
it is unadvisable to dynamically allocate ScopeLock as this violates the implied usage.

Definition at line 79 of file Mutex.hpp.

Constructor & Destructor Documentation

◆ ScopeLock() [1/3]

Os::ScopeLock::ScopeLock ( Mutex mutex)
explicit

construct the scope lock

Will lock the supplied mutex and will unlock the mutex when this object goes out of scope.

Parameters
mutex

Definition at line 46 of file Mutex.cpp.

◆ ~ScopeLock()

Os::ScopeLock::~ScopeLock ( )

unlock the scoped mutex

Definition at line 50 of file Mutex.cpp.

◆ ScopeLock() [2/3]

Os::ScopeLock::ScopeLock ( const ScopeLock other)
delete

copy constructor is forbidden

◆ ScopeLock() [3/3]

Os::ScopeLock::ScopeLock ( const ScopeLock other)
delete

copy constructor is forbidden

Member Function Documentation

◆ operator=()

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

assignment operator is forbidden


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