PIP 5.9.0
Platform-Independent Primitives
Loading...
Searching...
No Matches
PIProtectedVariable< T > Class Template Reference

Thread-safe variable template class. More...

#include <piprotectedvariable.h>

Classes

class  Pointer
 Pointer-like wrapper returned by getRef() while the protected value remains locked. More...

Public Member Functions

 PIProtectedVariable (T v=T())
 Constructs PIProtectedVariable and initialize variable by value v.
void set (T v)
 Replaces the protected value with v.
Pointer getRef ()
 Locks the value and returns wrapper-based access to it.
T get () const
 Returns a copy of the protected value.
PIProtectedVariable< T > & operator= (T v)
 Replaces the protected value with v.

Detailed Description

template<typename T>
class PIProtectedVariable< T >

Thread-safe variable template class.