bbtkVirtualExec.h

Go to the documentation of this file.
00001 /*=========================================================================                                                                               
00002   Program:   bbtk
00003   Module:    $RCSfile: bbtkVirtualExec.h,v $
00004   Language:  C++
00005   Date:      $Date: 2008/10/17 08:18:14 $
00006   Version:   $Revision: 1.17 $
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 __bbtkVirtualExec_h__
00041 #define __bbtkVirtualExec_h__
00042 
00043 #include "bbtkSystem.h"
00044 #include "bbtkComplexBlackBoxDescriptor.h"
00045 #include "bbtkFactory.h"
00046 
00047 namespace bbtk
00048 {
00049 
00050   class Interpreter;
00051   BBTK_FORWARD_DECLARE_POINTER(Interpreter);
00052 
00053   class BBTK_EXPORT VirtualExec : public Object
00054   {
00055     BBTK_ABSTRACT_OBJECT_INTERFACE(VirtualExec);
00056   public:
00057     typedef enum
00058     {
00059        NoDialog,
00060        TextDialog,
00061        GraphicalDialog
00062     }
00063     DialogModeType;
00064 
00065 
00067     void SetInterpreter(InterpreterPointer i) { mInterpreter = i; }
00069     InterpreterPointer GetInterpreter(); // { return mInterpreter.lock(); }
00071     //    const Interpreter::Pointer GetInterpreter() const { return mInterpreter; }
00072 
00074     virtual Factory::Pointer GetFactory() { return Factory::Pointer(); }
00076     // virtual const Factory* GetFactory() const { return 0; }
00077     
00079     virtual void SetInputs(const std::map<std::string,std::string>& m) = 0;
00080 
00083     virtual void SetNoExecMode(bool b) = 0;
00084 
00085     virtual bool GetNoExecMode() const = 0;
00086 
00088     virtual void SetDialogMode(DialogModeType t) = 0;
00089 
00092     virtual void SetNoErrorMode(bool b) = 0;
00093     virtual bool GetNoErrorMode() const = 0;
00094     //=================================================================
00096     virtual void LoadPackage(const std::string &name ) = 0;
00097 
00099     virtual void UnLoadPackage(const std::string &name ) = 0;
00100 
00102     virtual void BeginPackage (const std::string &name ) = 0;
00103 
00105     virtual void EndPackage () = 0;
00106 
00109     virtual void Define (const std::string &name,
00110                  const std::string& pack,
00111                  const std::string &scriptfilename) = 0;
00112  
00115     virtual void SetCurrentFileName (const std::string &name ) = 0;
00116 
00118     virtual void EndDefine () = 0;
00119 
00121     virtual void Kind(const std::string& kind) = 0;
00122 
00124     virtual void Create ( const std::string& boxType, const std::string&
00125     boxName) = 0;
00126 
00128     virtual void Destroy (const std::string &boxName) = 0;
00129 
00131     virtual void Connect (const std::string &boxfrom,
00132                   const std::string &output,
00133                   const std::string &boxto,
00134                   const std::string &input) = 0;
00135 
00137     virtual void Execute (const std::string &box) = 0;
00138 
00140     virtual void DefineInput (const std::string &name,
00141                       const std::string &box,
00142                       const std::string &input,
00143                       const std::string &help) = 0;
00144 
00146     virtual void DefineOutput (const std::string &name,
00147                        const std::string &box,
00148                        const std::string &output,
00149                        const std::string &help) = 0;     
00150   
00152     virtual void Set (const std::string &box, 
00153               const std::string &input, 
00154               const std::string &value) = 0;
00155 
00157     virtual std::string Get (const std::string &box, 
00158                      const std::string &output) = 0;
00159 
00161     virtual void SetWorkspaceName( const std::string& n ) = 0;
00162 
00164     virtual void Author(const std::string &authorName) = 0;
00165 
00167     virtual void Category(const std::string &categories) = 0;
00168 
00170     virtual void Description(const std::string &d) = 0;
00171 
00173     virtual void PrintBoxes() = 0;
00174 
00176     virtual std::string ShowGraph(const std::string &nameblackbox, 
00177                           const std::string &detailStr, 
00178                           const std::string &levelStr,
00179                           const std::string &output_file,
00180                           const std::string &custom_header,
00181                           const std::string &custom_title,
00182                           bool system_display = true) = 0;
00183 
00185     virtual std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true) = 0;
00186 
00188     virtual void ShowRelations(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr) = 0;
00189     
00190     virtual void Reset() = 0;
00191     
00193     virtual void SetMessageLevel(const std::string &kind, int level) = 0;
00194     
00196     virtual void HelpMessages() = 0;
00197 
00199     virtual void Print(const std::string & message) = 0;
00200 
00201     virtual ComplexBlackBoxDescriptor::Pointer GetWorkspace() 
00202     { return  ComplexBlackBoxDescriptor::Pointer(); }
00203   
00204   //  static const std::string& GetObjectDescription() = 0;
00205   //  { static std::string s("VirtualExec"); return s; }
00206   protected:
00207 
00208   private:
00209 
00211     InterpreterWeakPointer mInterpreter;
00212 
00213   };
00214 }
00215 #endif

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