MIRA
Public Member Functions | List of all members
ProtecteeMixin< T > Class Template Reference

Mixin class that can be used to add the Protectee concept used by ScopedAccess<Protectee(, void)> to an existing class. More...

#include <thread/ScopedAccess.h>

Inheritance diagram for ProtecteeMixin< T >:
Inheritance graph
[legend]

Public Member Functions

void lock ()
 
void unlock ()
 

Detailed Description

template<typename T>
class mira::ProtecteeMixin< T >

Mixin class that can be used to add the Protectee concept used by ScopedAccess<Protectee(, void)> to an existing class.

A typical use case would be a class with a member that should be accessed by concurrent threads.

class MyClass
{
public:
typedef ProtecteeMixin<std::string> ProtectedString;
ScopedAccess<ProtectedString> getString() {
return ScopedAccess<ProtectedString>(&mMyProtectedMember);
}
private:
ProtectedString mMyProtectedMember;
};

Member Function Documentation

◆ lock()

void lock ( )
inline

◆ unlock()

void unlock ( )
inline

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