[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue May 11 22:07:00 UTC 2004


CVS commit by okellogg: 

Implement <<CORBATypedef>>.


  M +1 -0      assocrules.cpp   1.24
  M +44 -34    codegenerators/idlwriter.cpp   1.13


--- kdesdk/umbrello/umbrello/assocrules.cpp  #1.23:1.24
@@ -268,4 +268,5 @@ AssocRules::Assoc_Rule AssocRules::m_Ass
             { at_UniAssociation,wt_UseCase,     wt_UseCase,     true,   false,  false,  false },
             { at_UniAssociation,wt_UseCase,     wt_Actor,       true,   false,  false,  false },
+            { at_Generalization,wt_Class,       wt_Datatype,    false,  false,  false,  false },
             { at_Generalization,wt_Class,       wt_Class,       false,  false,  false,  false },
             { at_Generalization,wt_Interface,   wt_Interface,   false,  false,  false,  false },

--- kdesdk/umbrello/umbrello/codegenerators/idlwriter.cpp  #1.12:1.13
@@ -56,4 +56,5 @@ bool IDLWriter::isOOClass(UMLClassifier 
         if (stype == "CORBAConstant" || stype == "CORBAEnum" ||
                 stype == "CORBAStruct" || stype == "CORBAUnion" ||
+                stype == "CORBASequence" || stype == "CORBAArray" ||
                 stype == "CORBATypedef")
                 return false;
@@ -193,7 +194,15 @@ void IDLWriter::writeClass(UMLClassifier
                 QString stype = c->getStereotype();
                 if (stype == "CORBAConstant") {
-                        idl << spc() << "// " << stype << " is Not Yet Implemented\n\n";
-                } else if(stype == "CORBAEnum") {
-                        if(myClass) {
+                        kdError() << "The stereotype " << stype << " cannot be applied to "
+                                  << c->getName() << ", but only to attributes." << endl;
+                        return;
+                }
+                if (myClass == NULL) {
+                        kdError() << "The stereotype " << stype
+                                  << " cannot be applied to " << c->getName()
+                                  << ", but only to classes." << endl;
+                        return;
+                }
+                if (stype == "CORBAEnum") {
                                 UMLAttributeList *atl = myClass->getFilteredAttributeList();
                                 UMLAttribute *at;
@@ -210,7 +219,5 @@ void IDLWriter::writeClass(UMLClassifier
                                 indentlevel--;
                                 idl << spc() << "};\n\n";
-                        }
-                } else if(stype == "CORBAStruct") {
-                        if(myClass) {
+                } else if (stype == "CORBAStruct") {
                                 UMLAttributeList *atl = myClass->getFilteredAttributeList();
                                 UMLAttribute *at;
@@ -224,9 +231,12 @@ void IDLWriter::writeClass(UMLClassifier
                                 indentlevel--;
                                 idl << spc() << "};\n\n";
-                        }
-                } else if(stype == "CORBAUnion") {
-                        idl << spc() << "// " << stype << " is Not Yet Implemented\n\n";
-                } else if(stype == "CORBATypedef") {
-                        idl << spc() << "// " << stype << " is Not Yet Implemented\n\n";
+                } else if (stype == "CORBAUnion") {
+                        idl << spc() << "// " << stype << " " << c->getName()
+                            << " is Not Yet Implemented\n\n";
+                } else if (stype == "CORBATypedef") {
+                        UMLClassifierList superclasses = c->getSuperClasses();
+                        UMLClassifier* firstParent = superclasses.first();
+                        idl << spc() << "typedef " << firstParent->getName() << " "
+                            << c->getName() << ";\n\n";
                 } else {
                         idl << spc() << "// " << stype << ": Unknown stereotype\n\n";






More information about the umbrello-devel mailing list