[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Dec 28 15:35:01 UTC 2004
CVS commit by okellogg:
Implement the codegen part of the functionality required for fixing bug 75010.
More work is required on the Modeller core and attrib/op/param dialogs.
M +24 -0 cppwriter.cpp 1.22
--- kdesdk/umbrello/umbrello/codegenerators/cppwriter.cpp #1.21:1.22
@@ -266,4 +266,28 @@ void CppWriter::writeHeaderFile (UMLClas
}
}
+
+ // Generate template parameters.
+ UMLClassifierListItemList template_params = c->getFilteredList(Uml::ot_Template);
+ if (template_params.count()) {
+ h << "template<";
+ for (UMLClassifierListItem *li = template_params.first(); li; ) {
+ QString formalName = li->getName();
+ QString typeName = li->getTypeName();
+ UMLClassifier *typeObj = li->getType();
+ if (typeName == "class") {
+ h << "class";
+ } else if (typeObj == NULL) {
+ kdError() << "CppWriter::writeClass(" << classifierInfo->className
+ << "): typeObj is NULL" << endl;
+ } else {
+ h << li->getTypeName();
+ }
+ h << " " << formalName;
+ if ((li = template_params.next()) != NULL)
+ h << ", ";
+ }
+ h << ">" << m_endl;
+ }
+
h << "class " << classifierInfo->className;
if (classifierInfo->superclasses.count() > 0)
More information about the umbrello-devel
mailing list