类定义:CMemberFuncPointer
=======================================================================
1 // MemberFuncPointer.h: interface for the CMemberFuncPointer class. 2 // 3 ////////////////////////////////////////////////////////////////////// 4 5 #if !defined(AFX_MEMBERFUNCPOINTER_H__4D78718D_778E_4427_BBC1_C5F2D52C64E5__INCLUDED_) 6 #define AFX_MEMBERFUNCPOINTER_H__4D78718D_778E_4427_BBC1_C5F2D52C64E5__INCLUDED_ 7 8 #if _MSC_VER > 1000 9 #pragma once 10 #endif // _MSC_VER > 1000 11 12 // 成员函数指针最大长度 13 #define MEMBER_FUNC_POINTER_MAX_SIZE 32 14 class CMemberFuncPointer 15 { 16 public: 17 void Reset(); 18 void Set(const void*pFunc,int p_size); 19 void Get(void*pFunc); 20 CMemberFuncPointer(); 21 CMemberFuncPointer(const char pointerdata[],int p_size); 22 CMemberFuncPointer(void* pointerdata,int p_size); 23 virtual ~CMemberFuncPointer(); 24 25 bool operator==(const CMemberFuncPointer &mfp) const; 26 bool operator!=(const CMemberFuncPointer &mfp) const; 27 28 CMemberFuncPointer& operator=(const CMemberFuncPointer &mfp); 29 30 private: 31 int m_size; 32 char m_pointer_data[MEMBER_FUNC_POINTER_MAX_SIZE]; 33 }; 34 35 #endif // !defined(AFX_MEMBERFUNCPOINTER_H__4D78718D_778E_4427_BBC1_C5F2D52C64E5__INCLUDED_)