bbtkComplexBlackBoxDescriptor.h

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkComplexBlackBoxDescriptor.h,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:12 $
00006   Version:   $Revision: 1.6 $
00007 =========================================================================*/
00008 
00009 /* ---------------------------------------------------------------------
00010 
00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
00013 *
00014 *  This software is governed by the CeCILL-B license under French law and 
00015 *  abiding by the rules of distribution of free software. You can  use, 
00016 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
00017 *  license as circulated by CEA, CNRS and INRIA at the following URL 
00018 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
00019 *  or in the file LICENSE.txt.
00020 *
00021 *  As a counterpart to the access to the source code and  rights to copy,
00022 *  modify and redistribute granted by the license, users are provided only
00023 *  with a limited warranty  and the software's author,  the holder of the
00024 *  economic rights,  and the successive licensors  have only  limited
00025 *  liability. 
00026 *
00027 *  The fact that you are presently reading this means that you have had
00028 *  knowledge of the CeCILL-B license and that you accept its terms.
00029 * ------------------------------------------------------------------------ */                                                                         
00030 
00031 
00041 #ifndef __bbtkComplexBlackBoxDescriptor_h__
00042 #define __bbtkComplexBlackBoxDescriptor_h__
00043 
00044 #include "bbtkBlackBoxDescriptor.h"
00045 #include "bbtkComplexBlackBoxInputDescriptor.h"
00046 #include "bbtkComplexBlackBoxOutputDescriptor.h"
00047 #include "bbtkFactory.h"
00048 #include <fstream>
00049 
00050 namespace bbtk
00051 {
00052 
00053   class ComplexBlackBox;
00054   typedef boost::shared_ptr<ComplexBlackBox> ComplexBlackBoxPointer;
00055 
00056   //==========================================================================
00057   class BBTK_EXPORT ComplexBlackBoxDescriptor : 
00058     public bbtk::BlackBoxDescriptor
00059   {
00060     BBTK_OBJECT_INTERFACE(ComplexBlackBoxDescriptor);
00061     typedef BlackBoxDescriptor Superclass;
00062   public:
00063     friend class ComplexBlackBox;
00064 
00065     static Pointer New(const std::string& name); 
00067     void SetFactory(Factory::Pointer f) { mFactory = f; }
00069     Factory::Pointer GetFactory() const { return mFactory.lock(); }
00070 
00072     //    void Release(bool release_package = true);
00073 
00075     //    const Factory* GetFactory() const { return mFactory; }
00076 
00078     virtual BlackBoxPointer NewBlackBox(const std::string& name);
00079 
00082     void Add ( const std::string& type,
00083                const std::string& name
00084                ); 
00085 
00087     void Remove( const std::string& name, bool remove_connections = true);
00088 
00091      void Connect ( const std::string& from,
00092                    const std::string& output,
00093                    const std::string& to,
00094                    const std::string& input
00095                    ); 
00097     void DefineInput ( const std::string& name,
00098                        const std::string& box,
00099                        const std::string& input,
00100                        const std::string& help);
00102     void DefineOutput ( const std::string& name,
00103                        const std::string& box,
00104                        const std::string& output,
00105                        const std::string& help);
00106  
00107  
00109     void SetScriptFileName(const std::string& n) { mScriptFileName = n; }
00111     std::string GetScriptFileName() const { return mScriptFileName; }
00112    
00114     void AddToExecutionList( const std::string& box );
00115 
00116     ComplexBlackBoxPointer GetPrototype() { return mPrototype; }
00117     void PrintBlackBoxes(); 
00118    
00120     void GetHelp(bool full=true) const;
00121  
00127     void InsertHtmlHelp ( std::ofstream& s, 
00128                           int detail, int level,
00129                           const std::string& output_dir = "",
00130                           bool relative_link = false);
00131 
00140     void InsertHTMLGraph( std::ofstream& s, 
00141                           int detail, int level, 
00142                           const std::string& output_dir = "",
00143                           bool relative_link = false );
00144     
00145 
00147     virtual void Check(bool recursive=true) const;
00148        
00149 
00150 
00151   protected:
00153     ComplexBlackBoxDescriptor(const std::string& name); 
00154 
00155   private:
00157     Factory::WeakPointer mFactory;
00159     ComplexBlackBoxPointer mPrototype;
00161     std::string mScriptFileName;
00162     
00163   };
00164   // class ComplexBlackBoxDescriptor
00165   //==========================================================================
00166 
00167 
00168  
00169 }
00170 // namespace bbtk
00171 #endif

Generated on Wed Nov 12 11:37:08 2008 for BBTK by  doxygen 1.5.6