Public Member Functions

kNet::Lockable< T > Class Template Reference

Stores an object of type T behind a mutex-locked shield. More...

#include <Lockable.h>

List of all members.

Public Member Functions

T & UnsafeGetValue ()
 Ignores the mutex guard and directly returns a reference to the locked value.
const T & UnsafeGetValue () const
 Ignores the mutex guard and directly returns a reference to the locked value.

Detailed Description

template<typename T>
class kNet::Lockable< T >

Stores an object of type T behind a mutex-locked shield.

To access the object, one has to acquire a lock to it first, and remember to free the lock when done. Use

See also:
Lock and
ConstLock to manage the locks in a RAII-style manner.

Member Function Documentation

template<typename T>
T& kNet::Lockable< T >::UnsafeGetValue (  )  [inline]

Ignores the mutex guard and directly returns a reference to the locked value.

Warning: This is unsafe for threading. Call only when the other threads accessing the data have been finished, or if you can guarantee by other means that the data will not be accessed.

Referenced by kNet::MessageConnection::Close().

template<typename T>
const T& kNet::Lockable< T >::UnsafeGetValue (  )  const [inline]

Ignores the mutex guard and directly returns a reference to the locked value.

Warning: This is unsafe for threading. Call only when the other threads accessing the data have been finished, or if you can guarantee by other means that the data will not be accessed.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines