bbtkBlackBoxDescriptor.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 __bbtkBlackBoxDescriptor_h__
00042 #define __bbtkBlackBoxDescriptor_h__
00043
00044 #include "bbtkObject.h"
00045 #include "bbtkBlackBoxInputDescriptor.h"
00046 #include "bbtkBlackBoxOutputDescriptor.h"
00047 #include <map>
00048 #include <fstream>
00049
00050 namespace bbtk
00051 {
00052
00053 class BlackBox;
00054 class Package;
00055 BBTK_FORWARD_DECLARE_POINTER(BlackBox);
00056 BBTK_FORWARD_DECLARE_POINTER(Package);
00057
00058
00059 class BBTK_EXPORT BlackBoxDescriptor : public Object
00060 {
00061 BBTK_ABSTRACT_OBJECT_INTERFACE(BlackBoxDescriptor);
00062 public:
00064 typedef BlackBoxInputDescriptor InputDescriptor;
00066 typedef BlackBoxOutputDescriptor OutputDescriptor;
00068 typedef std::map<std::string, InputDescriptor*> InputDescriptorMapType;
00070 typedef std::map<std::string, OutputDescriptor*> OutputDescriptorMapType;
00072 typedef enum
00073 {
00074 STANDARD=0,
00075 ADAPTOR=1,
00076 DEFAULT_ADAPTOR=2,
00077 GUI=3,
00078 DEFAULT_GUI=4
00079 }
00080 Kind;
00081
00083
00084
00087 virtual BlackBoxPointer NewBlackBox(const std::string& boxname) = 0;
00088
00090 const std::string& GetTypeName() const { return mTypeName; }
00091
00093 std::string GetFullTypeName() const;
00094
00096 const std::string& GetDescription() const { return mDescription; }
00097
00099 const std::string& GetAuthor() const { return mAuthor; }
00100
00102 const std::string& GetCategory() const { return mCategory; }
00103
00105 PackagePointer GetPackage() const { return mPackage; }
00106
00108 Kind GetKind() const { return mKind; }
00109
00111 virtual void GetHelp(bool full=true) const;
00112
00114 const InputDescriptorMapType& GetInputDescriptorMap() const
00115 { return mInput; }
00116
00118 const OutputDescriptorMapType& GetOutputDescriptorMap() const
00119 { return mOutput; }
00120
00122 const InputDescriptor* GetInputDescriptor(const std::string &name) const;
00123
00125 const OutputDescriptor* GetOutputDescriptor(const std::string &name) const;
00126
00128 void SetTypeName( const std::string& name ) { mTypeName=name; }
00129
00131 void AddToDescription( const std::string&, bool clear = false );
00132
00134 void AddToAuthor( const std::string&, bool clear = false );
00135
00137 void AddToCategory( const std::string&, bool clear = false );
00138
00140 void SetPackage(PackagePointer package) { mPackage = package; }
00141
00143 void SetKind(Kind kind) { mKind = kind; }
00144
00145
00146
00147
00148
00154 virtual void InsertHtmlHelp ( std::ofstream& s,
00155 int detail, int level,
00156 const std::string& output_dir = "",
00157 bool relative_link = false );
00159 virtual void Check(bool recursive=true) const;
00160
00161 protected:
00163 void AddInputDescriptor( BlackBoxInputDescriptor *d )
00164 { mInput[d->GetName()] = d; }
00166 void AddOutputDescriptor( BlackBoxOutputDescriptor *d )
00167 { mOutput[d->GetName()] = d; }
00168
00169
00171 std::string mTypeName;
00173 std::string mDescription;
00175 std::string mAuthor;
00177 std::string mCategory;
00179 Kind mKind;
00181 PackagePointer mPackage;
00183 InputDescriptorMapType mInput;
00185 OutputDescriptorMapType mOutput;
00186
00187 };
00188
00189
00190
00191
00192
00193 }
00194
00195 #endif