ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/FAS/src/keylist.h
(Generate patch)

Comparing trunk/FAS/src/keylist.h (file contents):
Revision 76 by tim, Tue Aug 13 22:33:51 2002 UTC vs.
Revision 77 by tim, Wed Aug 14 23:27:28 2002 UTC

# Line 32 | Line 32 | template<class T1,class T2, class THashFcn, class TEqu
32    private:
33      vector<T1>  _keys;
34      vector<T2> _data;
35 <    hash_map<T1, int, THashFcn, TEqualKey>  _hashTable;
35 >    hash_map<T1, int, THashFcn, TEqualKey> _hashTable;
36      int _num;
37  
38 +    void Clear();
39    public:
40      TKeyList();
41      ~TKeyList();
42  
43 <    int AddKey(T1 key, T2 data);
43 >    int AddKey(T1 key, T2 &data);
44      int GetIndex(T1 key);
45  
46      const T2& GetDataByKey(string &str) const;
47      const T2& GetDataByIndex(int index) const;
48      const T1& GetKeyByIndex(int index) const;
49  
50 <    void SetDataByIndex(int index, T2 data);
51 <    void SetDataByKey(T1 key, T2 data);
52 <    void ChangeKey(int index, T1 key);
50 >    void SetDataByIndex(int index, T2 &data);
51 >    void SetDataByKey(T1 key, T2 &data);
52 >    void ChangeKey(int index, T1 newKey);
53      void ChangeKey(T1 oldKey, T1 newKey);
54  
55   };
55
56 struct TEqstr
57 {
58  bool operator()(const string *s1, string *s2) const
59  {
60    return *s1 == *s2;
61  }
62 };
56  
64
57   typedef TKeyList<string, int, hash<string>, equal_to<string> > TNameList;
58  
59  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines