class ResolvedClass(object): """ contains all info for generating wrapping code of resolved class. "Resolved" means that template parameters and typedefs are resolved. """ def __init__(self, name, methods, attributes, decl, instance_map, local_map): self.name = name # resolve overloadings self.methods = OrderKeepingDictionary() for m in methods: self.methods.setdefault(m.name, []).append(m) self.attributes = attributes self.cpp_decl = decl # self.items = getattr(decl, "items", []) self.wrap_ignore = decl.annotations.get("wrap-ignore", False) self.no_pxd_import = decl.annotations.get("no-pxd-import", False) self.wrap_manual_memory = decl.annotations.get("wrap-manual-memory", []) # fix previous code where we had a bool ... if self.wrap_manual_memory == True: self.wrap_manual_memory = ["__old-model"] else: self.wrap_manual_memory == [] assert( isinstance(self.wrap_manual_memory, list) ) self.wrap_hash = decl.annotations.get("wrap-hash", []) self.local_map = local_map self.instance_map = instance_map def get_flattened_methods(self): return [m for methods in self.methods.values() for m in methods] def __str__(self): return "\n ".join([self.name] + map(str, self.methods))
class ResolvedClass(object): """ contains all info for generating wrapping code of resolved class. "Resolved" means that template parameters and typedefs are resolved. """ def __init__(self, name, methods, attributes, decl, instance_map, local_map): self.name = name # resolve overloadings self.methods = OrderKeepingDictionary() for m in methods: self.methods.setdefault(m.name, []).append(m) self.attributes = attributes self.cpp_decl = decl # self.items = getattr(decl, "items", []) self.wrap_ignore = decl.annotations.get("wrap-ignore", False) self.wrap_manual_memory = decl.annotations.get("wrap-manual-memory", False) self.wrap_hash = decl.annotations.get("wrap-hash", []) self.local_map = local_map self.instance_map = instance_map def get_flattened_methods(self): return [m for methods in self.methods.values() for m in methods] def __str__(self): return "\n ".join([self.name] + map(str, self.methods))
class ResolvedClass(object): """ contains all info for generating wrapping code of resolved class. "Resolved" means that template parameters and typedefs are resolved. """ def __init__(self, name, methods, attributes, decl, instance_map, local_map): self.name = name # resolve overloadings self.methods = OrderKeepingDictionary() for m in methods: self.methods.setdefault(m.name, []).append(m) self.attributes = attributes self.cpp_decl = decl # self.items = getattr(decl, "items", []) self.wrap_ignore = decl.annotations.get("wrap-ignore", False) self.local_map = local_map self.instance_map = instance_map def get_flattened_methods(self): return [m for methods in self.methods.values() for m in methods] def __str__(self): return "\n ".join([self.name] + map(str, self.methods))
class ResolvedClass(object): """ contains all info for generating wrapping code of resolved class. "Resolved" means that template parameters and typedefs are resolved. """ def __init__(self, name, methods, attributes, decl, instance_map, local_map): self.name = name # resolve overloadings self.methods = OrderKeepingDictionary() for m in methods: self.methods.setdefault(m.name, []).append(m) self.attributes = attributes self.cpp_decl = decl self.ns = get_namespace(decl.pxd_path, default_namespace) self.wrap_ignore = decl.annotations.get("wrap-ignore", False) self.no_pxd_import = decl.annotations.get("no-pxd-import", False) self.wrap_manual_memory = decl.annotations.get("wrap-manual-memory", []) # fix previous code where we had a bool ... if self.wrap_manual_memory == True: self.wrap_manual_memory = ["__old-model"] else: self.wrap_manual_memory == [] assert (isinstance(self.wrap_manual_memory, list)) self.wrap_hash = decl.annotations.get("wrap-hash", []) self.local_map = local_map self.instance_map = instance_map def get_flattened_methods(self): return [m for methods in self.methods.values() for m in methods] def __str__(self): return "\n ".join([self.name] + map(str, self.methods))