UDK 3.2.7 C/C++ API Reference
Classes | Static Public Member Functions
rtl::Static< T, Unique > Class Template Reference

Helper base class for a late-initialized (default-constructed) static variable, implementing the double-checked locking pattern correctly. More...

#include <instance.hxx>

List of all members.

Classes

struct  StaticInstance

Static Public Member Functions

static T & get ()
 Gets the static.

Detailed Description

template<typename T, typename Unique>
class rtl::Static< T, Unique >

Helper base class for a late-initialized (default-constructed) static variable, implementing the double-checked locking pattern correctly.

Derive from this class (common practice), e.g.

    struct MyStatic : public rtl::Static<MyType, MyStatic> {};
    ...
    MyType & rStatic = MyStatic::get();
    ...
    
Template Parameters:
Tvariable's type
UniqueImplementation trick to make the inner static holder unique, using the outer class (the one that derives from this base class)

Member Function Documentation

template<typename T , typename Unique >
static T& rtl::Static< T, Unique >::get ( ) [inline, static]

Gets the static.

Mutual exclusion is performed using the osl global mutex.

Returns:
static variable

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