22 #ifndef EVTSTRINGHASH_HH
23 #define EVTSTRINGHASH_HH
33 inline void add(
const std::string& str,T*
data);
34 inline T*
get(
const std::string& str);
40 inline int hash(
const std::string& str);
41 std::string*** _strings;
53 typedef std::string** EvtStringPtrPtr;
56 _strings=
new EvtStringPtrPtr[_size];
57 _data=
new TPtrPtr[_size];
58 _entries=
new int[_size];
74 for(j=0;j<_entries[i];j++){
75 delete _strings[i][j];
78 delete [] _strings[i];
94 typedef std::string* EvtStringPtr;
97 std::string** newstrings=
new EvtStringPtr[_entries[ihash]+1];
98 T** newdata=
new TPtr[_entries[ihash]+1];
102 for(i=0;i<_entries[ihash];i++){
103 newstrings[i]=_strings[ihash][i];
104 newdata[i]=_data[ihash][i];
107 newstrings[_entries[ihash]]=
new std::string;
108 *(newstrings[_entries[ihash]])=str;
109 newdata[_entries[ihash]]=data;
112 if(_entries[ihash]!=0){
113 delete [] _strings[ihash];
114 delete [] _data[ihash];
119 _strings[ihash]=newstrings;
120 _data[ihash]=newdata;
131 for (i=0;i<_entries[ihash];i++){
132 if (*(_strings[ihash][i])==str)
return _data[ihash][i];
144 const char* cstr=str.c_str();