1 /*=========================================================================
4 Module: $RCSfile: bbtkBlackBoxInputOutputDescriptor.h,v $
6 Date: $Date: 2008/07/23 11:46:11 $
7 Version: $Revision: 1.4 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
21 * \brief Class bbtk::BlackBoxInputOutputDescriptor : abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
24 * \class bbtk::BlackBoxInputOutputDescriptor
25 * \brief Abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
28 #ifndef __bbtkBlackBoxInputOutputDescriptor_h__
29 #define __bbtkBlackBoxInputOutputDescriptor_h__
31 #include "bbtkSystem.h"
38 class BBTK_EXPORT BlackBoxInputOutputDescriptor
41 /// Ctor with name, description and naure
42 BlackBoxInputOutputDescriptor(TypeInfo creator_type_info,
43 const std::string& name,
44 const std::string& description,
45 const std::string& nature,
46 bool copy_construct = true
48 : mCreatorTypeInfo(creator_type_info),
50 mDescription(description),
52 mCopyConstruct(copy_construct)
55 virtual ~BlackBoxInputOutputDescriptor() {}
57 /// Returns the TypeInfo of the BlackBoxDescriptor which created this descriptor
58 TypeInfo GetCreatorTypeInfo() const { return mCreatorTypeInfo; }
59 /// Returns the name of the in/output
60 const std::string& GetName() const { return mName; }
61 /// Returns the description of the in/output
62 const std::string& GetDescription() const { return mDescription; }
63 /// Returns the nature of the in/output
64 const std::string& GetNature() const { return mNature; }
65 /// Returns the type of the in/output
66 virtual TypeInfo GetTypeInfo() const = 0;
67 /// Returns the name of the type of the in/output
68 virtual std::string GetTypeName() const = 0;
69 /// Returns the DataInfo of the input (Type+Nature)
70 virtual DataInfo GetDataInfo() const
71 { return DataInfo(this->GetTypeInfo(),mNature); }
72 /// Returns the name of the type of the in/output
73 virtual std::string GetHumanTypeName() const = 0;
74 /// Returns true iff the type is a pointer to class
75 virtual bool IsPointerType() const = 0;
76 /// Returns true iff the in/output must be copied
77 /// by the copy constructor of the box
78 bool GetCopyConstruct() const { return mCopyConstruct; }
81 /// Default ctor is reserved to children
82 BlackBoxInputOutputDescriptor() : mCreatorTypeInfo(typeid(void)),
83 mName(""), mDescription(""),
89 /// The TypeInfo of the BlackBoxDescriptor which created this descriptor
90 TypeInfo mCreatorTypeInfo;
91 /// The name of the input/output
93 /// The description of the input/output
94 std::string mDescription;
95 /// The nature of the input/output
97 /// Does the in/output has to be copied by copy constructor
98 /// default = true. Must be set to false if it is
99 /// initialized by the user in bbUserCopyConstructor
100 /// (typically if it is a pointer)