Overview | Namespace | Class | Index | Help |
PUBLIC MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA |
PRIVATE MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA |
:: rtl ::
template< typename T, typename Unique >
class Static
- Base Classes
- None.
- Known Derived Classes
- None.
virtual | abstract | interface | template |
NO | NO | NO | YES |
- Summary
- Helper base class for a late-initialized (default-constructed) static variable, implementing the double-checked locking pattern correctly.
- How to Derive from this Class
-
Derive from this class (common practice), e.g.
struct MyStatic : public rtl::Static
{}; ... 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)
- File
- instance.hxx
Public Members
-
Static Methods
static T &
get( );Gets the static. Mutual exclusion is performed using the osl global mutex.
Private Members
-
Structs
StaticInstance
Copyright © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.