bbtkTranscriptor.h

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkTranscriptor.h,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:14 $
00006   Version:   $Revision: 1.12 $
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 
00040 #ifndef __bbtkTranscriptor_h__
00041 #define __bbtkTranscriptor_h__
00042 
00043 #include "bbtkVirtualExec.h"
00044 
00045 #include "bbtkSystem.h"
00046 #include <iostream>
00047 
00048 namespace bbtk
00049 {
00050 
00051   class /*BBTK_EXPORT*/ Transcriptor : public VirtualExec
00052   {
00053     BBTK_OBJECT_INTERFACE(Transcriptor);
00054     typedef VirtualExec Superclass;
00055   public:
00056     static Pointer New(const std::string& filename);
00057 
00058    
00060     void SetInputs(const std::map<std::string,std::string>& m) { mInputs = m; }
00061 
00064 
00065     //void SetNoExecMode(bool b) { mNoExecMode = b; }
00066     void SetNoExecMode(bool b)
00067     {
00068        if (b)
00069           m_Fp << "  e->SetNoExecMode(true);" << std::endl;
00070        else
00071           m_Fp << "  e->SetNoExecMode(false);" << std::endl;       
00072     }
00073 
00074     void SetNoErrorMode(bool b)
00075     {
00076        if (b)
00077           m_Fp << "  e->SetNoErrorMode(true);" << std::endl;
00078        else
00079           m_Fp << "  e->SetNoErrorMode(false);" << std::endl;       
00080     }
00081 
00082     bool GetNoExecMode() const { return false; }
00083     bool GetNoErrorMode() const { return false; }
00084 
00086     void SetDialogMode(DialogModeType t) { mDialogMode = t; }
00087 
00089     void LoadPackage(const std::string &name );
00090 
00092     void UnLoadPackage(const std::string &name );
00093 
00095     void BeginPackage (const std::string &name );
00096 
00098     void EndPackage ();
00099 
00102     void Define (const std::string &name,
00103                  const std::string& pack,
00104                  const std::string &scriptfilename);
00105 
00108     void SetCurrentFileName (const std::string &name );
00109 
00111     void EndDefine ();
00112 
00114     void Kind(const std::string& kind);
00115 
00117     void Create ( const std::string& boxType, const std::string& boxName);
00118 
00120     void Destroy (const std::string &boxName);
00121 
00123     void Connect (const std::string &boxfrom,
00124                   const std::string &output,
00125                   const std::string &boxto,
00126                   const std::string &input);
00127 
00129     void Execute(const std::string &box);
00130 
00132     void DefineInput (const std::string &name,
00133                       const std::string &box,
00134                       const std::string &input,
00135                       const std::string &help);
00136 
00138     void DefineOutput (const std::string &name,
00139                        const std::string &box,
00140                        const std::string &output,
00141                        const std::string &help);     
00142   
00144     void Set (const std::string &box, 
00145               const std::string &input, 
00146               const std::string &value);
00147 
00149     std::string Get (const std::string &box, 
00150                      const std::string &output);
00151 
00153     void SetWorkspaceName( const std::string& n );
00154 
00156     void Author(const std::string &authorName);
00157 
00159     void Category(const std::string &category);
00160 
00162     void Description(const std::string & d);
00163 
00165     void PrintBoxes();
00166 
00168     std::string ShowGraph(const std::string &nameblackbox, 
00169                           const std::string &detailStr, 
00170                           const std::string &levelStr,
00171                           const std::string &output_file,
00172                           const std::string &custom_header,
00173                           const std::string &custom_title,
00174                           bool system_display = true);
00175 
00177     std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true);
00178 
00180       void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
00181 
00182       void Reset();
00183  
00185     void SetMessageLevel(const std::string &kind,
00186                          int level);
00187 
00189     void HelpMessages();
00190     
00192     void Print(const std::string & message);
00193 
00194   //  static const std::string& GetObjectDescription()
00195   //  { static std::string s("Executer"); return s; }
00196 
00197   protected:
00198 
00199   private:
00201     Transcriptor(const std::string& filename);
00202 
00204     std::map<std::string,std::string> mInputs;
00205     
00207     DialogModeType mDialogMode;
00208     
00210     // std::ofstream *m_Fp;
00211     std::ofstream m_Fp;
00212   };
00213 }
00214 #endif

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