Changeset 2037

Show
Ignore:
Timestamp:
02/17/11 14:00:15 (2 years ago)
Author:
ahu
Message:

phase out boost::bimap so we can depend on 1.34 again

Location:
trunk/pdns/pdns
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnsparser.cc

    r1976 r2037  
    179179} 
    180180 
    181 DNSRecordContent::namemap_t& DNSRecordContent::getNamemap() 
    182 { 
    183   static DNSRecordContent::namemap_t namemap; 
     181DNSRecordContent::n2typemap_t& DNSRecordContent::getN2Typemap() 
     182{ 
     183  static DNSRecordContent::n2typemap_t namemap; 
    184184  return namemap; 
    185185} 
     186 
     187DNSRecordContent::t2namemap_t& DNSRecordContent::getT2Namemap() 
     188{ 
     189  static DNSRecordContent::t2namemap_t namemap; 
     190  return namemap; 
     191} 
     192 
    186193 
    187194DNSRecordContent::zmakermap_t& DNSRecordContent::getZmakermap() 
  • trunk/pdns/pdns/dnsparser.hh

    r1993 r2037  
    3232#include <boost/tuple/tuple.hpp> 
    3333#include <boost/tuple/tuple_comparison.hpp> 
    34 #include <boost/bimap.hpp> 
    3534#include "dns.hh" 
    3635#include "dnswriter.hh" 
     
    189188      getZmakermap()[make_pair(cl,ty)]=z; 
    190189 
    191     getNamemap().left.insert(make_pair(make_pair(cl,ty), name)); 
     190    getT2Namemap().insert(make_pair(make_pair(cl,ty), name)); 
     191    getN2Typemap().insert(make_pair(name, make_pair(cl,ty))); 
    192192  } 
    193193 
     
    201201  static uint16_t TypeToNumber(const string& name) 
    202202  { 
    203     namemap_t::right_const_iterator iter = getNamemap().right.find(name); 
    204     if(iter != getNamemap().right.end()) 
     203    n2typemap_t::const_iterator iter = getN2Typemap().find(name); 
     204    if(iter != getN2Typemap().end()) 
    205205      return iter->second.second; 
    206206     
     
    213213  static const string NumberToType(uint16_t num, uint16_t classnum=1) 
    214214  { 
    215     namemap_t::left_const_iterator iter = getNamemap().left.find(make_pair(classnum, num)); 
    216     if(iter == getNamemap().left.end())  
     215    t2namemap_t::const_iterator iter = getT2Namemap().find(make_pair(classnum, num)); 
     216    if(iter == getT2Namemap().end())  
    217217      return "TYPE" + lexical_cast<string>(num); 
    218218      //      throw runtime_error("Unknown DNS type with numerical id "+lexical_cast<string>(num)); 
     
    238238  typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t; 
    239239  typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t; 
    240   typedef boost::bimap<std::pair<uint16_t, uint16_t>, string > namemap_t; 
    241  
     240  typedef std::map<std::pair<uint16_t, uint16_t>, string > t2namemap_t; 
     241  typedef std::map<string, std::pair<uint16_t, uint16_t> > n2typemap_t; 
    242242  static typemap_t& getTypemap(); 
    243   static namemap_t& getNamemap(); 
     243  static t2namemap_t& getT2Namemap(); 
     244  static n2typemap_t& getN2Typemap(); 
    244245  static zmakermap_t& getZmakermap(); 
    245246};