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:
T variable's type
Unique Implementation 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

Generated on 15 Oct 2014 by  doxygen 1.6.1