diff --git a/bin/c++2py.in b/bin/c++2py.in index c5ed8c2..3e02f5a 100755 --- a/bin/c++2py.in +++ b/bin/c++2py.in @@ -37,7 +37,6 @@ parser.add_argument('--includes', '-I', action='append', help='Includes to pass parser.add_argument('--system_includes', '-isystem', action='append', help='System includes to pass to clang') parser.add_argument('--cxxflags', default = '', help='Options to pass to clang') parser.add_argument('--target_file_only', action='store_true', help='Disable recursion into included header files') -parser.add_argument('--wrapped_members_as_shared_refs', action='store_true', help='Disable recursion into included header files') args = parser.parse_args() @@ -78,8 +77,7 @@ W= Cpp2Desc(filename = args.filename, shell_command = shell_command, parse_all_comments = args.parse_all_comments, namespace_to_factor= (), # unused now - target_file_only = args.target_file_only, - wrapped_members_as_shared_refs = args.wrapped_members_as_shared_refs + target_file_only = args.target_file_only ) # Make the desc file diff --git a/c++/cpp2py/py_converter.hpp b/c++/cpp2py/py_converter.hpp index 3f8e4a0..2a77cd6 100644 --- a/c++/cpp2py/py_converter.hpp +++ b/c++/cpp2py/py_converter.hpp @@ -134,7 +134,7 @@ namespace cpp2py { if (p == nullptr) return NULL; py_type *self = (py_type *)p->tp_alloc(p, 0); if (self != NULL) { - if constexpr (is_ref && wrapped_members_as_shared_refs) { + if constexpr (is_ref) { // Keep parent alive for lifetime of self if (parent != nullptr) { self->parent = parent; diff --git a/cpp2py/cpp2desc.py b/cpp2py/cpp2desc.py index f5ba14f..2aac4c4 100644 --- a/cpp2py/cpp2desc.py +++ b/cpp2py/cpp2desc.py @@ -8,7 +8,7 @@ class Cpp2Desc: """ """ def __init__(self, filename, namespaces=(), classes= (), namespace_to_factor= (), appname= '', modulename = '', moduledoc ='', use_properties = False, members_read_only = True, converters = (), - compiler_options=None, includes= None, system_includes= None, libclang_location = None, shell_command = '', parse_all_comments = True, target_file_only = False, wrapped_members_as_shared_refs = False): + compiler_options=None, includes= None, system_includes= None, libclang_location = None, shell_command = '', parse_all_comments = True, target_file_only = False): """ Parse the file at construction @@ -59,12 +59,9 @@ def __init__(self, filename, namespaces=(), classes= (), namespace_to_factor= () target_file_only : bool Neglect any included files during desc generation [default = False] - - wrapped_members_as_shared_refs : bool - For classes with members which are a wrapped type, do not copy them on access but return them as shared references instead. Note that members with types that are only converted (e.g. std::vector) will continue to be copied on access [default = False] """ - for x in ['filename', 'namespaces', 'classes', 'namespace_to_factor', 'appname', 'modulename', 'moduledoc', - 'use_properties', 'members_read_only', 'shell_command', 'target_file_only', 'wrapped_members_as_shared_refs']: + for x in ['filename', 'namespaces', 'classes', 'namespace_to_factor', 'appname', 'modulename', 'moduledoc', + 'use_properties', 'members_read_only', 'shell_command', 'target_file_only']: setattr(self, x, locals()[x]) self.DE = dependency_analyzer.DependencyAnalyzer(converters) # parse the file diff --git a/cpp2py/mako/desc.py b/cpp2py/mako/desc.py index 1c9b5cc..742febf 100644 --- a/cpp2py/mako/desc.py +++ b/cpp2py/mako/desc.py @@ -3,7 +3,7 @@ from cpp2py.wrap_generator import * # The module -module = module_(full_name = "${W.modulename}", doc = r"${doc.replace_latex(W.moduledoc)}", app_name = "${W.appname}", wrapped_members_as_shared_refs = ${W.wrapped_members_as_shared_refs}) +module = module_(full_name = "${W.modulename}", doc = r"${doc.replace_latex(W.moduledoc)}", app_name = "${W.appname}") # Imports %if import_list: diff --git a/cpp2py/mako/wrap.cxx b/cpp2py/mako/wrap.cxx index dd73dcb..6c547b7 100644 --- a/cpp2py/mako/wrap.cxx +++ b/cpp2py/mako/wrap.cxx @@ -4,9 +4,6 @@ #include //for std::cout... using dcomplex = std::complex; -// global options -constexpr bool wrapped_members_as_shared_refs = ${int(module.wrapped_members_as_shared_refs)}; - // first the basic stuff #include #include diff --git a/cpp2py/wrap_generator.py b/cpp2py/wrap_generator.py index ebe05bd..0dca66c 100644 --- a/cpp2py/wrap_generator.py +++ b/cpp2py/wrap_generator.py @@ -688,7 +688,7 @@ class module_: """ Representation of a module """ - def __init__(self, full_name, doc = '', app_name = None, wrapped_members_as_shared_refs = False) : + def __init__(self, full_name, doc = '', app_name = None) : """ Parameters ---------- @@ -701,7 +701,6 @@ def __init__(self, full_name, doc = '', app_name = None, wrapped_members_as_sha """ self.full_name = full_name if app_name is None or app_name=="triqs" else app_name+"."+full_name - self.wrapped_members_as_shared_refs = wrapped_members_as_shared_refs self.name = full_name.rsplit('.',1)[-1] self.doc = doc self.classes = {} # dict : string -> class_. Key is the Python type