(self,
name: str,
params: Optional[List[Parameter]] = None,
const: Optional[bool] = None,
**kwargs)
| 1175 | return self |
| 1176 | |
| 1177 | def virtual(self, |
| 1178 | name: str, |
| 1179 | params: Optional[List[Parameter]] = None, |
| 1180 | const: Optional[bool] = None, |
| 1181 | **kwargs) -> 'Interface': |
| 1182 | |
| 1183 | # Add this parameter to the function |
| 1184 | this = Parameter('obj', 'void*', this=True) |
| 1185 | this.virtual_read = ['object_ptr.data'] |
| 1186 | exception_msg = Parameter('exception_msg', 'char*', hidden=True) |
| 1187 | exception_msg.virtual_read = ['${name}.data()'] |
| 1188 | exception_msg_size = Parameter('exception_msg_size', |
| 1189 | 'size_t', |
| 1190 | hidden=True) |
| 1191 | exception_msg_size.virtual_read = ['exception_msg.size()'] |
| 1192 | f = Function(name, |
| 1193 | params=[this, exception_msg, exception_msg_size] + |
| 1194 | (params or []), |
| 1195 | virtual=True, |
| 1196 | **kwargs) |
| 1197 | self.ifunctions.append(f) |
| 1198 | |
| 1199 | add_function(self.cname('set_' + name), |
| 1200 | params=gparams(obj=self.opaque_type, |
| 1201 | input=self.cname(name)), |
| 1202 | invoke='${{obj}}->{name} = ${{input}}'.format( |
| 1203 | name=self.mname(name))) |
| 1204 | return self |
| 1205 | |
| 1206 | def generate_function(self, f: Function): |
| 1207 | cname = self.cname(f.name) |
no test coverage detected