UDK 3.2.7 C/C++ API Reference
Classes | Static Public Member Functions
rtl::StaticWithArg< T, Data, 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  StaticInstanceWithArg

Static Public Member Functions

static T & get (const Data &rData)
 Gets the static.
static T & get (Data &rData)
 Gets the static.

Detailed Description

template<typename T, typename Data, typename Unique>
class rtl::StaticWithArg< T, Data, 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 Data , typename Unique >
static T& rtl::StaticWithArg< T, Data, Unique >::get ( const Data &  rData) [inline, static]

Gets the static.

Mutual exclusion is performed using the osl global mutex.

Returns:
static variable
template<typename T , typename Data , typename Unique >
static T& rtl::StaticWithArg< T, Data, Unique >::get ( Data &  rData) [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