]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkFactory.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkFactory.h
index a686fa4f9debc5e62513d9ecae06c2da7b839eaf..33d886174ae63564a5bf43dd9fd3d83890fe69da 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkFactory.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:13 $
-  Version:   $Revision: 1.16 $
+  Date:      $Date: 2009/06/08 14:50:03 $
+  Version:   $Revision: 1.17 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -57,21 +57,45 @@ namespace bbtk
   public:
     static Pointer New();
 
-    
+    // @name Packages management
+    //@{
+    /// Pushes back the names of the Package s which are in the Factory
     void GetPackagesList(std::vector<std::string>&);
+    /// Loads a dynamic library which contains a Package 
     void LoadPackage( const std::string& name );
+    /// Unloads a Package which was loaded from a dynamic library
     void UnLoadPackage( const std::string& name );
-    void PrintPackages(bool details = true, bool adaptors = false) const;
-    void HelpPackage(const std::string& name, bool adaptors = false) const;
-    void HelpBlackBox(const std::string& name, std::string& package,
-                     bool full=true ) const;
-    void ShowGraphTypes(const std::string& name) const;
+    /// Inserts a Package in the Factory
     void InsertPackage( Package::Pointer );
+    /// Removess a Package from the Factory
     void RemovePackage( Package::Pointer );
-
+    /// Returns the pointer on a Package provided by name
     Package::Pointer GetPackage(const std::string& name) const;
-
+    /// The type of map of packages
+    typedef std::map< std::string, Package::Pointer > PackageMapType;
+    /// Returns the map of Packages
+    const PackageMapType& GetPackageMap() const { return mPackageMap; }
+    //@}
+
+    // @name Methods which print help
+    //@{
+    /// Prints the list of Package
+    void PrintHelpListPackages(bool details = true, 
+                              bool adaptors = false) const;
+    /// Prints help on a particular Package
+    void PrintHelpPackage(const std::string& name, 
+                         bool adaptors = false) const;
+    /// Prints help on a BlackBoxDescriptor
+    void PrintHelpDescriptor(const std::string& name, 
+                            std::string& package,
+                            bool full=true ) const;
     
+    void ShowGraphTypes(const std::string& name) const;
+    // @}
+
+
+    /// @name Object creation methods
+    //@{
     BlackBox::Pointer NewBlackBox(const std::string& type, 
                           const std::string& name) const;
     
@@ -83,6 +107,15 @@ namespace bbtk
                               const DataInfo& typeout,
                               const std::string& name) const;
 
+    Connection::Pointer NewConnection(BlackBox::Pointer from,
+                                     const std::string& output,
+                                     BlackBox::Pointer to,
+                                     const std::string& input) const;
+   //@}
+
+    /// @name Package inspection methods
+    /// Allow to test if an Adaptor is present in the packages WITHOUT instanciating it
+    //@{
     bool FindAdaptor(const DataInfo& typein,
                     const DataInfo& typeout,
                     std::string& adaptor) const;
@@ -95,17 +128,14 @@ namespace bbtk
                            const DataInfo& typeout,
                            std::string& widget,
                            std::string& adaptor) const;
-
-    Connection::Pointer NewConnection(BlackBox::Pointer from,
-                                     const std::string& output,
-                                     BlackBox::Pointer to,
-                                     const std::string& input) const;
-
+    //@}
+  
     void WriteDotFilePackagesList(FILE *ff);
 
+    /// Releases all the packages of the Factory
     void Reset();
     
-    void CheckPackages() const;
+    void Check() const;
 
     typedef enum
       {
@@ -127,24 +157,16 @@ namespace bbtk
 
   private:
 
-    bool DoLoadPackage(std::string libname,
-                      std::string pkgname,
-                      std::string path);
-
-  public:
 
-    /// The type of map of packages
-    typedef std::map< std::string, Package::Pointer > PackageMapType;
-
-    const PackageMapType& GetPackageMap() const { return mPackageMap; }
-
-  private:
     /// The map of packages
     PackageMapType mPackageMap;
 
     /// The executer which created the factory (if any)
     ExecuterWeakPointer mExecuter;
 
+    bool DoLoadPackage(std::string libname,
+                      std::string pkgname,
+                      std::string path);
     void CloseAllPackages();
     void ClosePackage(PackageMapType::iterator& i);