00001 #ifndef __BASE_MANAGER_H 00002 #define __BASE_MANAGER_H 00003 00004 00005 #define MANAGER_ERROR -1 00006 00007 00008 #include "GXStandardDefines.h" 00009 #include "GXSizeableArray.h" 00010 #include "GXVectorArray.h" 00011 00012 struct SGXBaseEntry 00013 { 00014 char* szFileName; 00015 void* pData; 00016 }; 00017 00018 00019 class CGXBaseManager 00020 { 00021 public: 00022 CGXBaseManager(); 00023 virtual ~CGXBaseManager(); 00024 00025 //NOT optional, MUST BE CALLED!!!! 00026 virtual void Cleanup(); 00027 00028 virtual bool Init(CGXDeviceContainer* pDevice); 00029 00030 virtual bool LoadFromFile(char* szEntryName, int* pOut); 00031 00032 virtual void* GetEntry(UINT nIndex); 00033 00034 private: 00035 CGXVectorArray<SGXBaseEntry> m_Entries; 00036 CGXSizeableArray<char> m_EntryFileNames; 00037 virtual int AlreadyLoaded(char* szFilePath);//MODEL_ERROR (-1) if not loaded 00038 virtual char* AddFilePathEntry(char* szFilePath); 00039 00040 00041 protected: 00042 00043 CGXDeviceContainer* m_pDevice; 00044 00045 protected: 00046 virtual void* CreateObject(char* szFilePath)=0; 00047 virtual void DeleteObject(void* pObject)=0; 00048 virtual bool InitImpl()=0; 00049 virtual void CleanupImpl()=0; 00050 00051 00052 00053 }; 00054 00055 00056 void GXBaseEntryZeroer(SGXBaseEntry* pEntry); 00057 00058 00059 #endif