def create_source_files(self, obj): builder = CppBuilder(self) filenames = self.get_missing_function_filenames(obj.get_functions()) for path, functions in filenames.items(): logging.warning("Creating file %s", path) with open(path, "w") as f: for fn in functions: f.write(builder.get_function_declaration(fn)) f.write("\n{\n\n}\n\n")
def check_functions(self, iterator): functions = iterator.get_functions() missing_filenames = self.get_missing_function_filenames(functions) if not missing_filenames: return if self.qit.auto_create_files: self.create_source_files(iterator) builder = CppBuilder(self) filenames = list(sorted(missing_filenames.keys())) functions = sum(missing_filenames.values(), []) message = "File(s) {} are required because " \ "of the following function(s):\n {}\n".format( ",".join(filenames), ",".join(builder.get_function_declaration(f) for f in functions)) raise MissingFiles(message, filenames)
def declarations(self, obj): builder = CppBuilder(self) return [builder.get_function_declaration(fn) for fn in obj.get_functions() if fn.is_external()]
def run_collect(self, obj, args): self.check_all(obj) builder = CppBuilder(self) builder.build_collect(obj, args) return self.compile_builder(builder, obj.type)
def run_collect(self, iterator): builder = CppBuilder() builder.build_collect(iterator) return self.compile_builder(builder, iterator.output_type.basic_type)
def run_print_all(self, iterator): builder = CppBuilder() builder.build_print_all(iterator) self.compile_builder(builder, None)