osgEarth 2.1.1
Public Member Functions | Private Attributes

osgEarth::Threading::PerThread< T > Struct Template Reference

List of all members.

Public Member Functions

T & get ()
const T & get () const

Private Attributes

std::map< OpenThreads::Thread
*, T > 
_data
OpenThreads::Mutex _mutex

Detailed Description

template<typename T>
struct osgEarth::Threading::PerThread< T >

Template for per-thread data storage

Definition at line 298 of file ThreadingUtils.


Member Function Documentation

template<typename T>
T& osgEarth::Threading::PerThread< T >::get ( ) [inline]

Definition at line 300 of file ThreadingUtils.

                 {
            ScopedMutexLock lock(_mutex);
            return _data[OpenThreads::Thread::CurrentThread()];
        }

Here is the caller graph for this function:

template<typename T>
const T& osgEarth::Threading::PerThread< T >::get ( ) const [inline]

Definition at line 304 of file ThreadingUtils.

                             {
            ScopedMutexLock lock(_mutex);
            return _data[OpenThreads::Thread::CurrentThread()];
        }

Member Data Documentation

template<typename T>
std::map<OpenThreads::Thread*,T> osgEarth::Threading::PerThread< T >::_data [private]

Definition at line 309 of file ThreadingUtils.

template<typename T>
OpenThreads::Mutex osgEarth::Threading::PerThread< T >::_mutex [private]

Definition at line 310 of file ThreadingUtils.


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