bbtkTranscriptor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
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 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
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 Clear();
00124
00126 void Connect (const std::string &boxfrom,
00127 const std::string &output,
00128 const std::string &boxto,
00129 const std::string &input);
00130
00132 void Execute(const std::string &box);
00133
00135 void DefineInput (const std::string &name,
00136 const std::string &box,
00137 const std::string &input,
00138 const std::string &help);
00139
00141 void DefineOutput (const std::string &name,
00142 const std::string &box,
00143 const std::string &output,
00144 const std::string &help);
00145
00147 void Set (const std::string &box,
00148 const std::string &input,
00149 const std::string &value);
00150
00152 std::string Get (const std::string &box,
00153 const std::string &output);
00154
00156 void SetWorkspaceName( const std::string& n );
00157
00159 void Author(const std::string &authorName);
00160
00162 void Category(const std::string &category);
00163
00165 void Description(const std::string & d);
00166
00168 void PrintHelpListBoxes();
00169
00171 std::string ShowGraph(const std::string &nameblackbox,
00172 const std::string &detailStr,
00173 const std::string &levelStr,
00174 const std::string &output_file,
00175 const std::string &custom_header,
00176 const std::string &custom_title,
00177 bool system_display = true);
00178
00180 std::string ShowGraphInstances(const std::string &nameblackbox, int detail, int level, bool system_display=true);
00181
00183 void PrintHelpBlackBox(const std::string &nameblackbox, const std::string &detailStr, const std::string &levelStr);
00184
00185 void Reset();
00186
00188 void SetMessageLevel(const std::string &kind,
00189 int level);
00190
00192 void HelpMessages();
00193
00195 void Print(const std::string & message);
00196
00197
00198
00199
00200 protected:
00201
00202 private:
00204 Transcriptor(const std::string& filename);
00205
00207 std::map<std::string,std::string> mInputs;
00208
00210 DialogModeType mDialogMode;
00211
00213
00214 std::ofstream m_Fp;
00215 };
00216 }
00217 #endif