mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
Loading...
Searching...
No Matches
mrs_lib::Unlocker< LockedVarT, MutexT > Class Template Reference

Convenience class for RAII-style access to a varible within a Lockable object. More...

#include <lockable.h>

Public Member Functions

 Unlocker (Lockable< LockedVarT, MutexT > &lockable)
 
LockedVarT & operator* ()
 
LockedVarT * operator-> ()
 

Detailed Description

template<typename LockedVarT, typename MutexT>
class mrs_lib::Unlocker< LockedVarT, MutexT >

Convenience class for RAII-style access to a varible within a Lockable object.

Locks the internal mutex of the Lockable on construction, unlocks it on deconstruction, providing thread-safe pointer-like access to the variable within using operator*() and operator->().


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