1 /*=========================================================================
4 Module: $RCSfile: bbtkBlackBoxInputOutputDescriptor.h,v $
6 Date: $Date: 2008/04/04 08:04:05 $
7 Version: $Revision: 1.1 $
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, a description and type)
24 * \class bbtk::BlackBoxInputOutputDescriptor
25 * \brief Abstract descriptor of an input or an output of a black box (has a name, a description and type)
28 #ifndef __bbtkBlackBoxInputOutputDescriptor_h__
29 #define __bbtkBlackBoxInputOutputDescriptor_h__
31 #include "bbtkSystem.h"
38 class BBTK_EXPORT BlackBoxInputOutputDescriptor
41 /// Ctor with name and description
42 BlackBoxInputOutputDescriptor(TypeInfo creator_type_info,
43 const std::string& name,
44 const std::string& description,
45 bool copy_construct = true)
46 : mCreatorTypeInfo(creator_type_info),
48 mDescription(description),
49 mCopyConstruct(copy_construct)
52 /// Returns the TypeInfo of the BlackBoxDescriptor which created this descriptor
53 TypeInfo GetCreatorTypeInfo() { return mCreatorTypeInfo; }
54 /// Returns the name of the in/output
55 const std::string& GetName() const { return mName; }
56 /// Returns the description of the in/output
57 const std::string& GetDescription() const { return mDescription; }
58 /// Returns the type of the in/output
59 virtual TypeInfo GetTypeInfo() const = 0;
60 /// Returns the name of the type of the in/output
61 virtual std::string GetTypeName() const = 0;
62 /// Returns the name of the type of the in/output
63 virtual std::string GetHumanTypeName() const = 0;
64 /// Returns true iff the type is a pointer to class
65 virtual bool IsPointerType() const = 0;
66 /// Returns true iff the in/output must be copied
67 /// by the copy constructor of the box
68 bool GetCopyConstruct() const { return mCopyConstruct; }
71 /// Default ctor is reserved to children
72 BlackBoxInputOutputDescriptor() : mCreatorTypeInfo(typeid(void)),
73 mName(""), mDescription(""),
78 /// The TypeInfo of the BlackBoxDescriptor which created this descriptor
79 TypeInfo mCreatorTypeInfo;
80 /// The name of the input/output
82 /// The description of the input/output
83 std::string mDescription;
84 /// Does the in/output has to be copied by copy constructor
85 /// default = true. Must be set to false if it is
86 /// initialized by the user in bbUserCopyConstructor
87 /// (typically if it is a pointer)