mfx_function.h

来自「这是一个程序的一般架构方法」· C头文件 代码 · 共 65 行

H
65
字号
//-- {CycleCode: 266} file [0..894]
//-- {StartSubRegion: 268} module.ifndef [0..218]
// MFX_Function.h: interface for the MFX_Function class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MFX_FUNCTION_H__A46D2661_B869_46BB_83D9_D13E42EAA48A__INCLUDED_)
//-- {StartSubRegion: 269} module.define [219..295]
#define AFX_MFX_FUNCTION_H__A46D2661_B869_46BB_83D9_D13E42EAA48A__INCLUDED_
//-- {AddDecl: 267} module.vulnerableDeclarations [296..804]
//## begin module.epilog preserve=yes

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//获取Model文件夹
CString  MFXGetModelPath();

long MFXRounding(double x);

void * MFXGetMemShareBlack(UINT nSize = 1);
//释放共用内存块
void MFXUnLockMemShareBlack();

template < typename T > 
class Singleton
{
	static T * ms_Singeton;
public:
	 Singleton ()
	 {
		 ASSERT( ! ms_Singeton );
		 int offset = (int) (T*)1-(int)(Singleton <T> *)(T*)1;
		 ms_Singeton = (T *) ((int)this + offset);

	 }
	 ~Singleton()
	 {
		 ASSERT( ms_Singeton );
		 ms_Singeton = 0;
	 }
	 static T& GetSingleton()
	 {
		 ASSERT( ms_Singeton );
		 return ( * ms_Singeton );
	 }

	 static T* GetSignleton()
	 {
		 return ms_Singeton;
	 }
};
template < typename T> T* Singleton<T>::ms_Singeton = 0;

//template <typename  MyTYPE >
//inline MyTYPE *  MFXAllot( )
//{
//	return NULL; 
//}

//## end module.epilog
//-- {StartSubRegion: 270} module.endif [805..894]
#endif // !defined(AFX_MFX_FUNCTION_H__A46D2661_B869_46BB_83D9_D13E42EAA48A__INCLUDED_) 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?