#if !defined(_VREC_MAP_CH_06_03_2002_) #define _VREC_MAP_CH_06_03_2002_ // // VRecMap.h: interface for the VRecMap class. // //*****************************************************************************| // Vitaly Eremenko // created: 06.03.2002 // updated: 07.03.2002 //*****************************************************************************| ////////////////////////////////////////////////////////////////////// /* NOTES: Class TKey MUST implement the next methods: 1. TKey& operator = (const TKey &i_Rec); 2. bool operator == (const TKey &i_Rec) const; 2. bool operator < (const TKey &i_Rec) const; Class TValue MUST implement the next methods: 1. TValue& operator = (const TValue &i_Rec); 2. bool operator == (const TValue &i_Rec) const; For Template class does not needed dllexport/dllimport. */ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include #include template class VRecMap //----------------------------------------------- { protected: // data map m_mapData; typedef pair m_mapPair; map ::iterator m_pNextIter; map ::iterator m_pFindIter; public: VRecMap(); virtual ~VRecMap(); public: int InsertFromMap(VRecMap i_Map); TValue& operator[] (const TKey i_Key); TValue* GetItemByIndex(int i_niPos, TKey *o_pRetKey=NULL); int FindIndexByKey(TKey &i_Key, TValue *o_pRetVal=NULL); const TKey* FindNextKeyByValue(TValue &i_Val, TKey &i_StartKey); TValue* FindItemByKey(const TKey &i_Key); TValue* GetPrevItem(TKey *o_pRetKey=NULL); int SetLastPos(); TValue* GetNextItem(TKey *o_pRetKey=NULL); int SetInitPos(); int DeleteItem(const TKey &i_KeyDel); int AddItem(const TKey &i_Key, TValue &i_Rec); // = InsertItem int GetNumOfItems() { return m_mapData.size(); } void DeleteAll(); protected: }; //=============================================================================| #endif // !defined(_VREC_MAP_CH_06_03_2002_)