diff -r 78e9aa7fc192 bindings/python/ns3modulegen-modular.py --- a/bindings/python/ns3modulegen-modular.py Wed Jun 07 12:14:28 2017 +0300 +++ b/bindings/python/ns3modulegen-modular.py Wed Jun 28 07:00:04 2017 -0700 @@ -111,7 +111,6 @@ if hasattr(module_customization, 'post_register_methods'): module_customization.post_register_methods(root_module) - ns3modulegen_core_customizations.Object_customizations(root_module) ns3modulegen_core_customizations.Attribute_customizations(root_module) ns3modulegen_core_customizations.generate_callback_classes(root_module, diff -r 78e9aa7fc192 bindings/python/ns3modulegen_core_customizations.py --- a/bindings/python/ns3modulegen_core_customizations.py Wed Jun 07 12:14:28 2017 +0300 +++ b/bindings/python/ns3modulegen_core_customizations.py Wed Jun 28 07:00:04 2017 -0700 @@ -71,7 +71,7 @@ args = tuple([correct_ctype] + list(args[1:])) handler = type_handler(*args, **kwargs) - handler.set_tranformation(self, orig_ctype) + handler.set_transformation(self, orig_ctype) return handler def untransform(self, type_handler, declarations, code_block, expression): diff -r 78e9aa7fc192 bindings/python/ns3modulescan-modular.py --- a/bindings/python/ns3modulescan-modular.py Wed Jun 07 12:14:28 2017 +0300 +++ b/bindings/python/ns3modulescan-modular.py Wed Jun 28 07:00:04 2017 -0700 @@ -4,13 +4,14 @@ import os.path import pybindgen.settings -from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name +from pybindgen.castxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning, find_declaration_from_name from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.declarations.enumeration import enumeration_t from pygccxml.declarations.class_declaration import class_t -from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t, calldef_t - +from pygccxml.declarations.free_calldef import free_function_t +from pygccxml.declarations.calldef_members import constructor_t, member_function_t +from pygccxml.declarations.calldef import calldef_t ## we need the smart pointer type transformation to be active even ## during gccxml scanning. @@ -34,6 +35,8 @@ def get_ns3_relative_path(path): l = [] head = path + if not path: + return while head: new_head, tail = os.path.split(head) if new_head == head: @@ -58,7 +61,8 @@ ns3_header = get_ns3_relative_path(pygccxml_definition.location.file_name) except ValueError: # the header is not from ns3 return # ignore the definition, it's not ns-3 def. - + if not ns3_header: + return definition_module = self.headers_map[ns3_header] ## Note: we don't include line numbers in the comments because @@ -78,7 +82,9 @@ if isinstance(pygccxml_definition, member_function_t) \ and pygccxml_definition.parent.name == 'Object' \ and pygccxml_definition.name == 'GetObject': - template_args = templates.args(pygccxml_definition.demangled_name) + print ("************************", pygccxml_definition.name) + print ("************************", str(pygccxml_definition)) + template_args = templates.args(str(pygccxml_definition)) if template_args == ['ns3::Object']: global_annotations['template_instance_names'] = 'ns3::Object=>GetObject' @@ -222,18 +228,19 @@ callback_classes_file.write("]\n") -def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cflags): +def ns3_module_scan(top_builddir, module_name, headers_map, output_file_name, cflag): module_parser = ModuleParser('ns.%s' % module_name.replace('-', '_'), 'ns3') module_parser.add_pre_scan_hook(PreScanHook(headers_map, module_name)) #module_parser.add_post_scan_hook(post_scan_hook) - gccxml_options = dict( + castxml_options = dict( include_paths=[top_builddir], define_symbols={ #'NS3_ASSERT_ENABLE': None, #'NS3_LOG_ENABLE': None, }, - cflags=('--gccxml-cxxflags "%s -DPYTHON_SCAN"' % cflags) + #cflags=(' -std=c++14') + cflags=('-std=c++11 %s' % cflag) ) try: @@ -257,7 +264,7 @@ None, whitelist_paths=[top_builddir], #includes=['"ns3/everything.h"'], pygen_sink=output_sink, - gccxml_options=gccxml_options) + castxml_options=castxml_options) module_parser.scan_types() callback_classes_file = open(os.path.join(os.path.dirname(output_file_name), "callbacks_list.py"), "wt") diff -r 78e9aa7fc192 bindings/python/ns3modulescan.py --- a/bindings/python/ns3modulescan.py Wed Jun 07 12:14:28 2017 +0300 +++ b/bindings/python/ns3modulescan.py Wed Jun 28 07:00:04 2017 -0700 @@ -4,11 +4,13 @@ import os.path import pybindgen.settings -from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning +from pybindgen.castxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.declarations.class_declaration import class_t -from pygccxml.declarations.calldef import free_function_t, member_function_t, constructor_t, calldef_t +from pygccxml.declarations.free_calldef import free_function_t +from pygccxml.declarations.calldef_members import constructor_t, member_function_t +from pygccxml.declarations.calldef import calldef_t ## we need the smart pointer type transformation to be active even