123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //TableInfoMgr.h
- /////////////////////////////////////////////////////////////////////
- /********************************************************************
- 主要是对全局信息的管理
- ********************************************************************/
- #ifndef _TABLEINFO_MGR_H_
- #define _TABLEINFO_MGR_H_
- /////////////////////////////////////////////////////////////////////
- #include "mutexlock.h"
- /////////////////////////////////////////////////////////////////////
- template<typename Key, typename Value > class CList;
- typedef CList<long, void *> LongVoidLists;
- /////////////////////////////////////////////////////////////////////
- class CTableInfoMgr
- {
- public:
- CTableInfoMgr();
- virtual ~CTableInfoMgr();
- public:
- BOOL Init(int nElemSize, char *szTableName);
- BOOL End();
-
- int GetElementSize();
- const char *GetTableName();
- long GetItemCount();
- void *GetItemValue(long lIndex);
- BOOL Add(long lKey, void *pInfo);
- BOOL Modify(long lKey, void *pInfo);
- BOOL Delete(long lKey);
- BOOL DeleteAll();
- void *Find(long lKey);
- private:
- int m_nElementSize;
- char m_szTableName[64];
- LongVoidLists *m_ptTableInfo;
- };
- /////////////////////////////////////////////////////////////////////
- #endif //_TABLEINFO_MGR_H_
|