python: fix scanning to correctly look for the new SimpleRefCount templated class and declare it is reference counted
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Mon, 28 Dec 2009 17:55:12 +0000
changeset 5879 12a17646ad8e
parent 5878 34459001e1ba
child 5880 5fb5358e69dd
python: fix scanning to correctly look for the new SimpleRefCount templated class and declare it is reference counted
bindings/python/ns3modulescan.py
--- a/bindings/python/ns3modulescan.py	Mon Dec 28 17:53:52 2009 +0000
+++ b/bindings/python/ns3modulescan.py	Mon Dec 28 17:55:12 2009 +0000
@@ -26,28 +26,6 @@
 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 @@
         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