(self, module_config: config.ModuleConfig, config: config.CodegenConfig)
| 143 | self.__name_to_enum: Dict[str, cpp.Enumeration] = {} |
| 144 | |
| 145 | def load(self, module_config: config.ModuleConfig, config: config.CodegenConfig): |
| 146 | # load module info |
| 147 | self.module_name = module_config.module_name |
| 148 | self.meta_dir = module_config.meta_dir |
| 149 | self.api = module_config.api |
| 150 | |
| 151 | # get files |
| 152 | meta_files = glob.glob(os.path.join(module_config.meta_dir, "**", "*.h.meta"), recursive=True) |
| 153 | |
| 154 | # load meta files |
| 155 | for meta_file in meta_files: |
| 156 | # load header db |
| 157 | db = HeaderDatabase(self) |
| 158 | db.load_header(meta_file, config) |
| 159 | self.header_dbs.append(db) |
| 160 | |
| 161 | # append to fast search |
| 162 | for record in db.records: |
| 163 | if record.name in self.__name_to_record: |
| 164 | raise Exception(f"Record name {record.name} is duplicated") |
| 165 | self.__name_to_record[record.name] = record |
| 166 | for enum in db.enums: |
| 167 | if enum.name in self.__name_to_enum: |
| 168 | raise Exception(f"Enum name {enum.name} is duplicated") |
| 169 | self.__name_to_enum[enum.name] = enum |
| 170 | |
| 171 | def each_cpp_types_with_attr(self, visitor) -> None: |
| 172 | for db in self.header_dbs: |
no test coverage detected