Changeset 612 for trunk/pdns/pdns/dnsparser.hh
- Timestamp:
- 03/22/06 18:47:01 (4 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/dnsparser.hh (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/dnsparser.hh
r579 r612 180 180 { 181 181 if(f) 182 typemap[make_pair(cl,ty)]=f;182 getTypemap()[make_pair(cl,ty)]=f; 183 183 if(z) 184 zmakermap[make_pair(cl,ty)]=z;185 186 namemap[make_pair(cl,ty)]=name;184 getZmakermap()[make_pair(cl,ty)]=z; 185 186 getNamemap()[make_pair(cl,ty)]=name; 187 187 } 188 188 189 189 static uint16_t TypeToNumber(const string& name) 190 190 { 191 for(namemap_t::const_iterator i= namemap.begin(); i!=namemap.end();++i)191 for(namemap_t::const_iterator i=getNamemap().begin(); i!=getNamemap().end();++i) 192 192 if(!strcasecmp(i->second.c_str(), name.c_str())) 193 193 return i->first.second; … … 198 198 static const string NumberToType(uint16_t num) 199 199 { 200 if(! namemap.count(make_pair(1,num)))200 if(!getNamemap().count(make_pair(1,num))) 201 201 return "#" + lexical_cast<string>(num); 202 202 // throw runtime_error("Unknown DNS type with numerical id "+lexical_cast<string>(num)); 203 return namemap[make_pair(1,num)];203 return getNamemap()[make_pair(1,num)]; 204 204 } 205 205 … … 210 210 protected: 211 211 typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t; 212 static typemap_t typemap;213 214 212 typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t; 215 static zmakermap_t zmakermap;216 217 213 typedef std::map<std::pair<uint16_t, uint16_t>, string > namemap_t; 218 static namemap_t namemap; 214 215 static typemap_t& getTypemap(); 216 static namemap_t& getNamemap(); 217 static zmakermap_t& getZmakermap(); 219 218 }; 220 219