|
@@ -28,6 +28,7 @@ re_typecode = re.compile('([\da-z]+)_(\d+)')
|
|
|
classcode2txt = {}
|
|
|
typecode2txt = {}
|
|
|
typeandclass = []
|
|
|
+new_rdatafactory_users = []
|
|
|
generic_code = 65536 # something larger than any code value
|
|
|
rdata_declarations = ''
|
|
|
class_definitions = ''
|
|
@@ -271,15 +272,24 @@ def generate_rrparam(fileprefix, basemtime):
|
|
|
class_utxt = class_tuple[1].upper()
|
|
|
indent = ' ' * 8
|
|
|
typeandclassparams += indent
|
|
|
+
|
|
|
+ # By default, we use OldRdataFactory (see bug #2497). If you
|
|
|
+ # want to pick RdataFactory for a particular type, add it to
|
|
|
+ # new_rdatafactory_users.
|
|
|
+ if type_txt in new_rdatafactory_users:
|
|
|
+ rdf_class = 'RdataFactory'
|
|
|
+ else:
|
|
|
+ rdf_class = 'OldRdataFactory'
|
|
|
+
|
|
|
if class_tuple[1] != 'generic':
|
|
|
typeandclassparams += 'add("' + type_utxt + '", '
|
|
|
typeandclassparams += str(type_code) + ', "' + class_utxt
|
|
|
typeandclassparams += '", ' + str(class_code)
|
|
|
- typeandclassparams += ', RdataFactoryPtr(new OldRdataFactory<'
|
|
|
+ typeandclassparams += ', RdataFactoryPtr(new ' + rdf_class + '<'
|
|
|
typeandclassparams += class_txt + '::' + type_utxt + '>()));\n'
|
|
|
else:
|
|
|
typeandclassparams += 'add("' + type_utxt + '", ' + str(type_code)
|
|
|
- typeandclassparams += ', RdataFactoryPtr(new OldRdataFactory<'
|
|
|
+ typeandclassparams += ', RdataFactoryPtr(new ' + rdf_class + '<'
|
|
|
typeandclassparams += class_txt + '::' + type_utxt + '>()));\n'
|
|
|
|
|
|
rrparam_temp = open(placeholder, 'r')
|