1 /*=========================================================================
4 Module: $RCSfile: bbtkBlackBoxInputDescriptor.h,v $
6 Date: $Date: 2008/02/06 14:14:22 $
7 Version: $Revision: 1.2 $
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::BlackBoxInputDescriptor : abstract descriptor of an input of a black box (stores a name, a description and type)
24 * \class bbtk::BlackBoxInputDescriptor
25 * \brief Abstract descriptor of an input of a black box (stores a name, a description and type)
28 #ifndef __bbtkBlackBoxInputDescriptor_h__
29 #define __bbtkBlackBoxInputDescriptor_h__
31 #include "bbtkSystem.h"
37 class BBTK_EXPORT BlackBoxInputDescriptor
46 /// Ctor with name and description
47 BlackBoxInputDescriptor(TypeInfo creator_type_info,
48 const std::string& name,
49 const std::string& description,
50 OptionType option = MANDATORY,
51 bool copy_construct = true)
52 : mCreatorTypeInfo(creator_type_info),
53 mName(name), mDescription(description),
54 mOption(option), mCopyConstruct(copy_construct)
57 /// Returns the TypeInfo of the BlackBoxDescriptor which created this descriptor
58 TypeInfo GetCreatorTypeInfo() { return mCreatorTypeInfo; }
59 /// Returns the name of the input
60 const std::string& GetName() const { return mName; }
61 /// Returns the description of the input
62 const std::string& GetDescription() const { return mDescription; }
63 /// Returns the type of the input
64 virtual TypeInfo GetTypeInfo() const = 0;
65 /// Returns the name of the type of the input
66 virtual std::string GetTypeName() const = 0;
67 /// Returns the name of the type of the input
68 virtual std::string GetHumanTypeName() const = 0;
69 /// Returns true iff the type is a pointer to class
70 virtual bool IsPointerType() const = 0;
71 /// Returns the option of the input
72 OptionType GetOption() const { return mOption; }
73 /// Returns true iff the input must be copied
74 /// by the copy constructor of the box
75 bool GetCopyConstruct() const { return mCopyConstruct; }
78 /// Default ctor is private
79 BlackBoxInputDescriptor() : mCreatorTypeInfo(typeid(void)),
80 mName(""), mDescription(""),
83 /// The TypeInfo of the BlackBoxDescriptor which created this descriptor
84 TypeInfo mCreatorTypeInfo;
85 /// The name of the input
87 /// The description of the input
88 std::string mDescription;
89 /// The option of the input
91 /// Does the input has to be copied by copy constructor
92 /// default = true. Must be set to false if it is
93 /// initialized by the user in bbUserCopyConstructor
94 /// (typically if it is a pointer)