LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
|
Helper base class for a late-initialized static variable, implementing the double-checked locking pattern correctly. More...
#include <instance.hxx>
Static Public Member Functions | |
static T & | get () |
Gets the static. More... | |
Helper base class for a late-initialized static variable, implementing the double-checked locking pattern correctly.
struct MyStatic : public rtl::StaticWithInit<MyType, MyStatic> { MyType operator () () { ... return MyType( ... ); } }; ... MyType & rStatic = MyStatic::get(); ...
T | variable's type |
InitData | initializer functor class |
Unique | Implementation trick to make the inner static holder unique, using the outer class (the one that derives from this base class). Default is InitData (common practice). |
Data | Initializer functor's return type. Default is T (common practice). |
|
inlinestatic |
Gets the static.
Mutual exclusion is performed using the osl global mutex.