[Uml-devel] kdesdk/umbrello/umbrello/codegenerators

Brian Thomas thomas at mail630.gsfc.nasa.gov
Wed Sep 3 15:30:14 UTC 2003


CVS commit by thomas: 

Further debugging C++ code generation. Fixed specific code gen policy
interface for this generator.


  A            codewriter.cpp   1.1 [GPL (v2+)]
  A            codewriter.h   1.1 [GPL (v2+)]
  A            cppcodegenerationformbase.ui   1.1
  A            cppcodegenerationpolicy.cpp   1.1 [no copyright GPL (v2+) GENERATED FILE]
  A            cppcodegenerationpolicy.h   1.1 [no copyright GPL (v2+) GENERATED FILE]
  A            cppcodegenerationpolicypage.cpp   1.1 [no copyright GPL (v2+) GENERATED FILE]
  A            cppcodegenerationpolicypage.h   1.1 [no copyright GPL (v2+) GENERATED FILE]
  M +8 -1      cppcodegenerator.cpp   1.4
  M +1 -1      cppcodegenerator.h   1.3


--- kdesdk/umbrello/umbrello/codegenerators/cppcodegenerator.cpp  #1.3:1.4
@@ -18,4 +18,5 @@
 
 #include "cppcodegenerator.h"
+#include "cppcodegenerationpolicy.h"
 #include "cppsourcecodedocument.h"
 #include "cppheadercodedocument.h"
@@ -37,4 +38,8 @@ cerr<<"CPPCodeGenerator "<<this<<" creat
 CPPCodeGenerator::~CPPCodeGenerator ( ) { 
     cerr<<"CPPCodeGenerator "<<this<<" destroyed"<<endl;
+        // destroy all separately owned codedocuments (e.g. header docs)
+        for (CPPHeaderCodeDocument *doc = m_headercodedocumentVector.first(); doc; doc=m_headercodedocumentVector.next())
+                delete doc;
+
 };
 
@@ -196,4 +201,6 @@ void CPPCodeGenerator::initAttributes ( 
 cerr<<"CPP CODE GENERTOR INIT"<<endl;
 
+        setPolicy ( new CPPCodeGenerationPolicy(this, getPolicy()) );
+
        // load Classifier documents from parent document
         initFromParentDocument();
@@ -204,5 +211,5 @@ cerr<<"CPP CODE GENERTOR INIT"<<endl;
 
         // set our 'writeout' policy for that code document
-        setCreateProjectMakefile(DEFAULT_BUILD_MAKE_DOC);
+        setCreateProjectMakefile(DEFAULT_BUILD_MAKEFILE);
 
 cerr<<"CPP CODE GENERTOR INIT - end"<<endl;

--- kdesdk/umbrello/umbrello/codegenerators/cppcodegenerator.h  #1.2:1.3
@@ -33,5 +33,5 @@ class CPPCodeGenerator : public CodeGene
 public:
 
-        static const bool DEFAULT_BUILD_MAKE_DOC = false;
+        static const bool DEFAULT_BUILD_MAKEFILE = false;
 
         // Constructors/Destructors






More information about the umbrello-devel mailing list