60#define SINGLETON_CONSTRUCTOR( CLS ) \
62 static CLS * GetInstance(void) \
64 return CSingletonT<CLS>::Get(_T(#CLS)); \
67 CCopyImpossible m_cCopyImpossible; \
68 friend class CSingletonT<CLS>; \
106 CDestory(TInfo* P) : m_pInfo(P) {}
110 if ( m_pInfo->pType != NULL )
112 delete m_pInfo->pType;
113 m_pInfo->pType = NULL;
125 static TYP*
Get(LPCTSTR lpszName)
131 CStr str =
CStr::Fmt(_T(
"_!Tnb1Ton_%08X_%s"), ::GetCurrentProcessId(), lpszName);
132 int iRc = s_cSharedMem.
Open(str,
sizeof(TInfo));
138 pInfo =
static_cast<TInfo*
>(s_cSharedMem.
Get());
141 pInfo->pType =
new TYP;
142 static CDestory s_cDest(pInfo);
148 while ( pInfo->isInit != 1 )
157 pInfo =
static_cast<TInfo*
>(s_cSharedMem.
Get());
158 while ( pInfo->isInit != 1 )
LPVOID Get(void)
[取得] アドレス参照.
bool HasMemory(void)
[確認] 共有メモリの有無
int Open(LPCTSTR lpszMemName, UINT uMemSize)
[操作] オープン
static TYP * Get(LPCTSTR lpszName)
[取得] インスタンス取得
static CStrT Fmt(const TCHAR *lpszFormat,...)
[作成] 書式付き文字列作成