1: 2: 3: /********************* 4: * * 5: * PROJECT INCLUDES * 6: * * 7: *********************/ 8: 9: 10: #include "rdata.h" 11: #include "rdata_a.h" 12: #include "rdata_mx.h" 13: #include "rdata_name.h" 14: #include "rdata_raw.h" 15: #include "rdata_soa.h" 16: 17: 18: /*************** 19: * * 20: * METHOD NEW * 21: * * 22: ***************/ 23: 24: /* 25: * NOTE: You must update this function if you create a new type of RData class. 26: * These are ordered in accordance with my WAG about frequency of occurrance. 27: */ 28: 29: RDataPtr RData::New(RRType i_ty, RRClass i_cl) { 30: if (RDataA::IsMatch(i_ty,i_cl)==true) return new RDataA; 31: if (RDataName::IsMatch(i_ty,i_cl)==true) return new RDataName; 32: if (RDataMX::IsMatch(i_ty,i_cl)==true) return new RDataMX; 33: if (RDataSOA::IsMatch(i_ty,i_cl)==true) return new RDataSOA; 34: return new RDataRaw; 35: } 36: 37: 38: /********************* 39: * * 40: * RDATA DESTRUCTOR * 41: * * 42: *********************/ 43: 44: 45: RData::~RData() {} 46: 47: 48: