]> Creatis software - bbtk.git/blobdiff - kernel/appli/bbfy/bbfy.cpp
*** MAJOR CHANGE *** NOT WORKING YET !!!
[bbtk.git] / kernel / appli / bbfy / bbfy.cpp
index 347babc2b89afcf162727fc8b7eeff4cd77c41a5..d528eb916e4e5ae60a104655e136064b33f67a44 100644 (file)
@@ -79,9 +79,9 @@ private:
   std::vector<std::string> mInclude;
   std::vector<std::string> mTypedef;
 
-  std::string mUserConstructor;
-  std::string mUserCopyConstructor;
-  std::string mUserDestructor;
+  std::string mUserSetDefaultValues;
+  std::string mUserInitializeProcessing;
+  std::string mUserFinalizeProcessing;
 
   typedef struct
   {
@@ -276,25 +276,30 @@ void bbfy::ParseXML()
       bbtk::GetTextOrClear(BB.getChildNode("namespace"),mNamespace);
     }
 
-  // UserConstructor body
-  if (BB.nChildNode("constructor"))
+  // UserSetDefaultValues body
+  if (BB.nChildNode("defaultValues"))
     {
-      bbtk::GetTextOrClear(BB.getChildNode("constructor"),mUserConstructor);
+      bbtk::GetTextOrClear(BB.getChildNode("defaultValues"),
+                          mUserSetDefaultValues);
     }
     
-  // UserCopyConstructor body
-  if (BB.nChildNode("copyconstructor"))
+  // UserInitializeProcessing body
+  if (BB.nChildNode("initializeProcessing"))
     {
-      bbtk::GetTextOrClear(BB.getChildNode("copyconstructor"),mUserCopyConstructor);
+      bbtk::GetTextOrClear(BB.getChildNode("initializeProcessing"),
+                          mUserInitializeProcessing);
     }
     
 // UserDestructor body
-  if (BB.nChildNode("destructor"))
// UserFinalizeProcessing body
+  if (BB.nChildNode("finalizeProcessing"))
     {
-      bbtk::GetTextOrClear(BB.getChildNode("destructor"),mUserDestructor);
+      bbtk::GetTextOrClear(BB.getChildNode("finalizeProcessing"),
+                          mUserFinalizeProcessing);
     }
-    // Template parameters
+
+
+
+     // Template parameters
   //  mNbTemplateParam = BB.nChildNode("template");
 
   if ( BB.nChildNode("template") > 0)
@@ -430,6 +435,30 @@ void bbfy::ParseXML()
      {
        bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
      }
+
+
+
+
+
+
+
+   // OBSOLETE/UNSUPPORTED TAGS
+  // WARN IF OBSOLETE TAGS PROVIDED
+  if (BB.nChildNode("constructor"))
+    {
+      std::cout << "WARNING !!! The tag <constructor> is obsolete !!"<<std::endl;
+    }
+  if (BB.nChildNode("destructor"))
+    {
+      std::cout << "WARNING !!! The tag <destructor> is obsolete !!"<<std::endl;
+    }
+  if (BB.nChildNode("copy_constructor"))
+    {
+      std::cout << "WARNING !!! The tag <copy_constructor> is obsolete !!"<<std::endl;
+    }
+
+
+
 }
 //==========================================================================
 
@@ -584,6 +613,7 @@ void bbfy::CreateHeader()
     }
 
   // Declare user constructor / copy cons /destr 
+  /*
   mFile << "//=================================================================="<<std::endl;
   mFile << "/// User callback called in the box contructor"<<std::endl;
 
@@ -594,7 +624,7 @@ void bbfy::CreateHeader()
   mFile << "virtual void bbUserDestructor();"<<std::endl;
   mFile << "//=================================================================="<<std::endl; 
 
-
+  */
 
   // Inputs
   std::vector<IO>::iterator ioi;
@@ -1045,24 +1075,20 @@ void bbfy::CreateCode()
     }
 
   // User constr / copy constr / destr implementation
-  mFile <<"void "<<mName<<"::bbUserConstructor()"<<std::endl;
-  mFile << "{"<<std::endl;
-  //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserConstructor()"<<std::endl);"<<std::endl;
-  
-  mFile << mUserConstructor << std::endl;
+  mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
+  mFile << "{"<<std::endl;  
+  mFile << mUserSetDefaultValues << std::endl;
   mFile << "}" << std::endl;
 
-  mFile <<"void "<<mName<<"::bbUserCopyConstructor(bbtk::BlackBox::Pointer)"
+  mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
        <<std::endl;
   mFile << "{"<<std::endl;
-  //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserCopyConstructor()"<<std::endl);"<<std::endl;
-  mFile << mUserCopyConstructor << std::endl;
+  mFile << mUserInitializeProcessing << std::endl;
   mFile << "}" << std::endl;
 
-  mFile <<"void "<<mName<<"::bbUserDestructor()"<<std::endl;
+  mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
   mFile << "{"<<std::endl;
-  //mFile<<"bbtkDebugMessage(\"Kernel\",9,\""<<mName<<::bbUserDestructor()"<<std::endl);"<<std::endl;
-  mFile << mUserDestructor << std::endl;
+  mFile << mUserFinalizeProcessing << std::endl;
   mFile << "}" << std::endl;