]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkPackage.cxx
re indent
[bbtk.git] / kernel / src / bbtkPackage.cxx
index ecaa1ccacbdf4e86fb2132a7ad8667cbb6806f95..66465e9813e2bb200a50e611848ad8c3d3e2cc88 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkPackage.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/06/09 08:42:12 $
-  Version:   $Revision: 1.31 $
+  Date:      $Date: 2010/09/12 14:52:25 $
+  Version:   $Revision: 1.35 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -134,7 +134,7 @@ namespace bbtk
       {
        bbtkDebugMessage("package",5,
                         "    Descriptor has already been released"
-                                <<bbtkendl);
+                       <<bbtkendl);
        return;
                  }
     //    bbtkDebugMessage("package",3,
@@ -148,7 +148,7 @@ namespace bbtk
        if (pack.expired()) 
          {
            bbtkDebugMessage("package",2,
-                                        "     ... and caused its package death"
+                             "     ... and caused its package death"
                             <<bbtkendl);
            return;
          } // pack.expired
@@ -227,7 +227,7 @@ namespace bbtk
                                 <<"') : package expired during release : bailing out"<<bbtkendl);
                break;
              }
-           
+  
 #if defined(MACOSX)
                  BlackBoxDescriptor::Pointer desc = pack.lock()->mDescriptorMap[*descname];
                  if ( (dyn==0) || (boost::dynamic_pointer_cast<ComplexBlackBoxDescriptor>(desc)) )
@@ -244,10 +244,7 @@ namespace bbtk
        UnLoadDynamicLibrary(pack);
        // Unload orphan dl packages 
        Package::UnLoadReleasedDynamicallyLoadedPackages();
-       
 
-       
-       
       }
     
 #ifdef BBTK_COMPILE_DEBUG_MESSAGES
@@ -577,16 +574,15 @@ namespace bbtk
   {
     if (pack.expired() || (!pack.lock()->mDynamicLibraryHandler))
       return;
-    
-    
+
     std::string packname = pack.lock()->GetName();
     bbtkDebugMessage("package",5,"==> Package::UnLoadDynamicLibrary('"
                     <<packname<<"')"
                     <<std::endl);
-    
+
     if (!pack.lock()->GetDescriptorMap().empty())
       {
-       
+
        bbtkDebugMessage("package",5,"   Package not empty ... abort"
                         <<std::endl);
        return;
@@ -595,7 +591,6 @@ namespace bbtk
                        <<"DescriptorMap not empty "
                        <<BBTK_INTERNAL_ERROR_MESSAGE);
        */
-       
       }
 
     if (pack.use_count()!=1)
@@ -618,13 +613,11 @@ namespace bbtk
        bbtkDebugMessage("package",1,"==> package '"<<packname
                         <<"' put in the 'to unload' list"
                         <<std::endl);
-
       }
 
     bbtkDebugMessage("package",5,"<== Package::UnLoadDynamicLibrary('"
                     <<packname<<"')"
-                    <<std::endl);
-    
+                    <<std::endl); 
   }
   //==========================================================================
 
@@ -684,6 +677,18 @@ namespace bbtk
   }
   //==========================================================================
 
+//ups4 EED borrame
+       bool Package::ifBoxExist( std::string type)     
+    {
+               bool ok=false;
+               DescriptorMapType::const_iterator i = mDescriptorMap.find(type);
+               if (i != mDescriptorMap.end())  
+               {
+                       ok=true;
+               }
+               return ok;
+    }
+       
   //==========================================================================
   /// Creates an instance of a black box of type <type> with name <name>
   BlackBox::Pointer Package::NewBlackBox(const std::string& type, 
@@ -1130,6 +1135,8 @@ namespace bbtk
     bbtkDebugMessageInc("kernel",9,"Package<"<<GetName()<<">::CreateHtmlPage(\""
                        <<filename<<"\")"<<bbtkendl);
 
+//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1133"<<std::endl;
+
     //---------------------
     // Open output file
     std::ofstream s;
@@ -1220,7 +1227,7 @@ namespace bbtk
          << bbtk::GetVersion() << "</TD></TR>\n";
        s << "</TABLE>\n";
       }
-
+//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1225"<<std::endl;
     //-------------------
     // Table of contents
     // Black boxes list
@@ -1231,64 +1238,64 @@ namespace bbtk
     s << "<p><TABLE cellspacing=0  cellpadding=3>\n";
 
     DescriptorMapType::const_iterator i;
-    for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end(); ++i) 
-      {
-       if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD) 
-         continue;
+//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1236"<<std::endl;
+    for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end(); ++i) {
+               if ( i->second->GetKind() != BlackBoxDescriptor::STANDARD) 
+                       continue;
        
-       std::string name = i->second->GetTypeName();
-       Utilities::html_format(name);
-       std::string descr = i->second->GetDescription();
-       //Utilities::html_format(descr);
-
-        s << "<TR>";
-       s << "<TD style='vertical-align: top;'>";
-       s << "&nbsp;&nbsp;&nbsp;<a name=\"toc_"<<name
-         <<"\" href=\"#"<<name<<"\">"
-         <<name<<"</a>";
-       s << "</TD> ";
-       s << " <TD style='vertical-align: top;'>" << descr << " </TD>";
-        s << "</TR>\n";
-      }    
-    s << "</TABLE>\n";
-    
+               std::string name = i->second->GetTypeName();
+               Utilities::html_format(name);
+               std::string descr = i->second->GetDescription();
+               //Utilities::html_format(descr);
+//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1246"<<std::endl;
+               s << "<TR>";
+               s << "<TD style='vertical-align: top;'>";
+               s << "&nbsp;&nbsp;&nbsp;<a name=\"toc_"<<name
+               <<"\" href=\"#"<<name<<"\">"
+               <<name<<"</a>";
+               s << "</TD> ";
+               s << " <TD style='vertical-align: top;'>" << descr << " </TD>";
+               s << "</TR>\n";
+               }    
+               s << "</TABLE>\n";
+
+
+               s << "</ul>\n";
+               s << "</div>\n";
     
-    s << "</ul>\n";
-    s << "</div>\n";
-    
-    //-------------------
-    // Adaptors list
-    if (mAdaptorMap.size()>0) 
-      {
-       //  s << "<div class=\"contents\">\n";
-       s << "<p><b> Adaptors : </b>\n";
-       s << "<ul>\n";
-
-       //    DescriptorMapType::const_iterator i;
-       s << "<p><TABLE cellspacing=0  cellpadding=3>\n";
-       for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end();++i) 
-         {
-           if ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) 
-             continue;
-    
-           std::string name = i->second->GetTypeName();
-           Utilities::html_format(name);
-           std::string descr = i->second->GetDescription();
+               //-------------------
+               // Adaptors list
+               if (mAdaptorMap.size()>0) 
+               {
+                       //  s << "<div class=\"contents\">\n";
+                       s << "<p><b> Adaptors : </b>\n";
+                       s << "<ul>\n";
+//std::cout<<"JCP bbtkPackage.cxx void Package::CreateHtmlPage() ln 1268"<<std::endl;
+                       //    DescriptorMapType::const_iterator i;
+                       s << "<p><TABLE cellspacing=0  cellpadding=3>\n";
+                       for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end();++i) 
+                       {
+                               if ( i->second->GetKind() == BlackBoxDescriptor::STANDARD) 
+                                       continue;
     
-           s << "<TR>";
-           s << "<TD style='vertical-align: top;'>";
-           s << "&nbsp;&nbsp;&nbsp;<a name=\"toc_"<<name
-             <<"\" href=\"#"<<name<<"\">"
-             <<name<<"</a>";
-           s << "</TD> ";
-           s << " <TD style='vertical-align: top;'>" << descr << " </TD>";
-           s << "</TR>\n";
-         }    
-       s << "</TABLE>\n";
-
-       s << "</ul>\n";
-       s << "</div>\n";
-      }
+                               std::string name = i->second->GetTypeName();
+                               Utilities::html_format(name);
+                               std::string descr = i->second->GetDescription();
+                   
+                               s << "<TR>";
+                               s << "<TD style='vertical-align: top;'>";
+                               s << "&nbsp;&nbsp;&nbsp;<a name=\"toc_"<<name
+                                 <<"\" href=\"#"<<name<<"\">"
+                                 <<name<<"</a>";
+                               s << "</TD> ";
+                               s << " <TD style='vertical-align: top;'>" << descr << " </TD>";
+                               s << "</TR>\n";
+                       }    
+                       s << "</TABLE>\n";
+
+                       s << "</ul>\n";
+                       s << "</div>\n";
+               }
     
     
     //  s << "<div class=\"node\">\n";
@@ -1307,23 +1314,23 @@ namespace bbtk
     //-------------------
     // Computes output directory from filename to pass it to 
     // BlackBoxDescriptor::InsertHtmlHelp
-    std::string dir;
+               std::string dir;
 
-    std::string::size_type slash_position = filename.find_last_of("/\\");
+               std::string::size_type slash_position = filename.find_last_of("/\\");
 
 
-       if (slash_position != std::string::npos) {
-      if (slash_position == 0)
-         slash_position = 1;  
-      dir = filename.substr(0,slash_position);
-    }
+               if (slash_position != std::string::npos) {
+                       if (slash_position == 0)
+                        slash_position = 1;  
+                       dir = filename.substr(0,slash_position);
+               }
 
-    for (i=mDescriptorMap.begin();
-        i!=mDescriptorMap.end();
-        ++i) 
-      {
-       i->second->InsertHtmlHelp(s,detail,level,dir,relative_link);
-      }    
+               for (i=mDescriptorMap.begin();
+                i!=mDescriptorMap.end();
+                ++i) 
+               {
+                       i->second->InsertHtmlHelp(s,detail,level,dir,relative_link);
+               }    
 
     //----------------------
     // Footer