Mercurial > projects > qtd
comparison generator/cppgenerator.cpp @ 355:08c1ca7975ab
obviated redundant virtual dispatch callbacks
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Tue, 25 May 2010 17:23:11 +0300 |
parents | cf8a415f3f32 |
children |
comparison
equal
deleted
inserted
replaced
354:18bd68f586c6 | 355:08c1ca7975ab |
---|---|
228 s << "_getter"; | 228 s << "_getter"; |
229 | 229 |
230 s << "("; | 230 s << "("; |
231 const AbstractMetaClass *owner = java_function->ownerClass(); | 231 const AbstractMetaClass *owner = java_function->ownerClass(); |
232 | 232 |
233 bool has_d_ptr = java_function->isConstructor() && owner && (owner->hasVirtualFunctions()/* || owner->typeEntry()->isObject()*/ ); | 233 bool has_d_ptr = java_function->isConstructor() && owner && (owner->isPolymorphic()/* || owner->typeEntry()->isObject()*/ ); |
234 const AbstractMetaArgumentList arg_list = java_function->arguments(); | 234 const AbstractMetaArgumentList arg_list = java_function->arguments(); |
235 if (has_d_ptr) { | 235 if (has_d_ptr) { |
236 s << "void *d_ptr"; | 236 s << "void *d_ptr"; |
237 if (arg_list.size() > 0) | 237 if (arg_list.size() > 0) |
238 s << ", "; | 238 s << ", "; |
248 | 248 |
249 s << ")"; | 249 s << ")"; |
250 if (java_function->isConstant()) | 250 if (java_function->isConstant()) |
251 s << " const"; | 251 s << " const"; |
252 } | 252 } |
253 | |
254 void CppGenerator::writeInclude(QTextStream &s, Include inc) | |
255 { | |
256 if (!inc.name.isEmpty()) { | |
257 s << "#include "; | |
258 if (inc.type == Include::IncludePath) | |
259 s << "<"; | |
260 else | |
261 s << "\""; | |
262 s << inc.name; | |
263 if (inc.type == Include::IncludePath) | |
264 s << ">"; | |
265 else | |
266 s << "\""; | |
267 s << endl; | |
268 } | |
269 } |