bbtkComplexBlackBoxDescriptor.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
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
00073
00075
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
00165
00166
00167
00168
00169 }
00170
00171 #endif