Overview | Namespace | Class | 索引 | 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 |
:: salhelper ::
template< typename SingletonClass >
class SingletonRef
- Base Classes
- 非,不,無.
- Known Derived Classes
- 非,不,無.
事実上の | abstract | interface | template |
NO | NO | NO | YES |
- 要約
- template for 器具/実施するing singleton classes.
- Description
- Such classes can be instanciated everytimes they are needed. But the 内部の wrapped 反対する will be created one times only. Of course its used 資源s are 言及/関連d one times only too. This template 持つ/拘留する it alive till the last 言及/関連 is gone. その上の all 操作/手術s on this 言及/関連 are threadsafe. Only calls 直接/まっすぐに to the 内部の 反対する (which 修正する its 明言する/公表する) must be made threadsafe by the 反対する itself or from outside.
- ATTENTION!
- To 妨げる the code against race 条件s, its not
許すd to start 操作/手術s inside the ctor
of the 内部の wrapped 反対する - especialy 操作/手術s
which needs a 言及/関連 to the same singleton too.
The only chance to supress such strange 星座s
is a lazy-init 機械装置.
- a) The singleton class can 供給する a special init() method, which must be called as first after 創造.
- b) The singleton class can call a special impl_init() method implicit for every called interface method.
- とじ込み/提出する
- singletonref.hxx
Public Members
-
Methods
SingletonRef( );基準 ctor.
~SingletonRef( );基準 dtor. SingletonClass *
操作者->( ) const;許すs rSingle->someBodyOp(). SingletonClass &
操作者*( ) const;許すs (*rSingle).someBodyOp().
私的な Members
-
Structs
SingletonLockInit creates an own mutex for guarding static contents.
Methods
::osl::Mutex &
ownStaticLock( ) const;
Static Data
SingletonClass * m_pInstance; pointer to the 内部の wrapped singleton. sal_Int32 m_nRef; ref count, which 規制する 創造 and 除去するing of m_pInstance.
Copyright © 2012, The Apache ソフトウェア 創立/基礎, Licensed under the Apache License, 見解/翻訳/版 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache ソフトウェア 創立/基礎. Other 指名するs may be trademarks of their 各々の owners.