このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


class SingletonRef
Language

The 解放する/自由な and Open 生産性 控訴
解放(する)d: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: 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.
公式文書,認める その上の that this singleton pattern can work only, if all 使用者 of such singleton are 位置を示すd inside the same library! Because static values cant be 輸出(する)d - e.g. from windows libraries.
とじ込み/提出する
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.

最高の,を越す of Page

Apache Software Foundation

Copyright & License | Privacy | 接触する Us | 寄付する | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are 登録(する)d trademarks of The Apache ソフトウェア 創立/基礎. The Apache feather logo is a trademark of The Apache ソフトウェア 創立/基礎. Other 指名するs appearing on the 場所/位置 may be trademarks of their 各々の owners.