diff --git a/bindings/python/ns3modulescan.py b/bindings/python/ns3modulescan.py index d6bb26efd..4ecb14946 100644 --- a/bindings/python/ns3modulescan.py +++ b/bindings/python/ns3modulescan.py @@ -26,28 +26,6 @@ import warnings warnings.filterwarnings(category=WrapperWarning, action='ignore') type_annotations = { - '::ns3::RefCountBase': { - 'incref_method': 'Ref', - 'decref_method': 'Unref', - 'peekref_method': 'GetReferenceCount', - 'automatic_type_narrowing': 'true', - }, - '::ns3::Object': { - 'incref_method': 'Ref', - 'decref_method': 'Unref', - 'peekref_method': 'GetReferenceCount', - 'automatic_type_narrowing': 'true', - }, - '::ns3::Packet': { - 'incref_method': 'Ref', - 'decref_method': 'Unref', - 'peekref_method': 'GetReferenceCount', - }, - '::ns3::CallbackImplBase': { - 'incref_method': 'Ref', - 'decref_method': 'Unref', - 'peekref_method': 'GetReferenceCount', - }, '::ns3::AttributeChecker': { 'automatic_type_narrowing': 'true', 'allow_subclassing': 'false', @@ -175,6 +153,13 @@ def pre_scan_hook(dummy_module_parser, if pygccxml_definition.name.endswith('Helper'): global_annotations['allow_subclassing'] = 'false' + if pygccxml_definition.decl_string.startswith('::ns3::SimpleRefCount<'): + global_annotations['incref_method'] = 'Ref' + global_annotations['decref_method'] = 'Unref' + global_annotations['peekref_method'] = 'GetReferenceCount' + global_annotations['automatic_type_narrowing'] = 'true' + return + if pygccxml_definition.decl_string.startswith('::ns3::Callback<'): # manually handled in ns3modulegen_core_customizations.py global_annotations['ignore'] = None