2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkBlackBoxInputOutputDescriptor.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.7 $
34 =========================================================================*/
39 * \brief Class bbtk::BlackBoxInputOutputDescriptor : abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
42 * \class bbtk::BlackBoxInputOutputDescriptor
43 * \brief Abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
46 #ifndef __bbtkBlackBoxInputOutputDescriptor_h__
47 #define __bbtkBlackBoxInputOutputDescriptor_h__
49 #include "bbtkSystem.h"
56 class BBTK_EXPORT BlackBoxInputOutputDescriptor
59 /// Ctor with name, description and naure
60 BlackBoxInputOutputDescriptor(TypeInfo creator_type_info,
61 const std::string& name,
62 const std::string& description,
63 const std::string& nature,
64 bool copy_construct = true
66 : mCreatorTypeInfo(creator_type_info),
68 mDescription(description),
70 mCopyConstruct(copy_construct)
73 virtual ~BlackBoxInputOutputDescriptor() {}
75 /// Returns the TypeInfo of the BlackBoxDescriptor which created this descriptor
76 TypeInfo GetCreatorTypeInfo() const { return mCreatorTypeInfo; }
77 /// Returns the name of the in/output
78 const std::string& GetName() const { return mName; }
79 /// Returns the description of the in/output
80 const std::string& GetDescription() const { return mDescription; }
81 /// Returns the nature of the in/output
82 const std::string& GetNature() const { return mNature; }
83 /// Returns the type of the in/output
84 virtual TypeInfo GetTypeInfo() const = 0;
85 /// Returns the name of the type of the in/output
86 virtual std::string GetTypeName() const = 0;
87 /// Returns the DataInfo of the input (Type+Nature)
88 virtual DataInfo GetDataInfo() const
89 { return DataInfo(this->GetTypeInfo(),mNature); }
90 /// Returns the name of the type of the in/output
91 virtual std::string GetHumanTypeName() const = 0;
92 /// Returns true iff the type is a pointer to class
93 virtual bool IsPointerType() const = 0;
94 /// Returns true iff the in/output must be copied
95 /// by the copy constructor of the box
96 bool GetCopyConstruct() const { return mCopyConstruct; }
99 /// Default ctor is reserved to children
100 BlackBoxInputOutputDescriptor() : mCreatorTypeInfo(typeid(void)),
101 mName(""), mDescription(""),
107 /// The TypeInfo of the BlackBoxDescriptor which created this descriptor
108 TypeInfo mCreatorTypeInfo;
109 /// The name of the input/output
111 /// The description of the input/output
112 std::string mDescription;
113 /// The nature of the input/output
115 /// Does the in/output has to be copied by copy constructor
116 /// default = true. Must be set to false if it is
117 /// initialized by the user in bbUserCopyConstructor
118 /// (typically if it is a pointer)