PIP 5.6.1
Platform-Independent Primitives
Classes | Public Member Functions | List of all members
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.
 
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.