F´ Flight Software - C/C++ Documentation
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/MutexInterface.hpp>

Public Member Functions

 ScopeLock (MutexInterface &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...
 
ScopeLock & operator= (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 88 of file MutexInterface.hpp.

Constructor & Destructor Documentation

◆ ScopeLock() [1/3]

Os::ScopeLock::ScopeLock ( MutexInterface &  mutex)
inlineexplicit

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 94 of file MutexInterface.hpp.

◆ ~ScopeLock()

Os::ScopeLock::~ScopeLock ( )
inline

unlock the scoped mutex

Definition at line 97 of file MutexInterface.hpp.

◆ 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 file: