1 /*=========================================================================
3 Module: $RCSfile: bbtkBlackBoxInputOutputDescriptor.h,v $
5 Date: $Date: 2010/01/14 13:17:27 $
6 Version: $Revision: 1.6 $
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
34 * \brief Class bbtk::BlackBoxInputOutputDescriptor : abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
37 * \class bbtk::BlackBoxInputOutputDescriptor
38 * \brief Abstract descriptor of an input or an output of a black box (has a name, description, type and nature)
41 #ifndef __bbtkBlackBoxInputOutputDescriptor_h__
42 #define __bbtkBlackBoxInputOutputDescriptor_h__
44 #include "bbtkSystem.h"
51 class BBTK_EXPORT BlackBoxInputOutputDescriptor
54 /// Ctor with name, description and naure
55 BlackBoxInputOutputDescriptor(TypeInfo creator_type_info,
56 const std::string& name,
57 const std::string& description,
58 const std::string& nature,
59 bool copy_construct = true
61 : mCreatorTypeInfo(creator_type_info),
63 mDescription(description),
65 mCopyConstruct(copy_construct)
68 virtual ~BlackBoxInputOutputDescriptor() {}
70 /// Returns the TypeInfo of the BlackBoxDescriptor which created this descriptor
71 TypeInfo GetCreatorTypeInfo() const { return mCreatorTypeInfo; }
72 /// Returns the name of the in/output
73 const std::string& GetName() const { return mName; }
74 /// Returns the description of the in/output
75 const std::string& GetDescription() const { return mDescription; }
76 /// Returns the nature of the in/output
77 const std::string& GetNature() const { return mNature; }
78 /// Returns the type of the in/output
79 virtual TypeInfo GetTypeInfo() const = 0;
80 /// Returns the name of the type of the in/output
81 virtual std::string GetTypeName() const = 0;
82 /// Returns the DataInfo of the input (Type+Nature)
83 virtual DataInfo GetDataInfo() const
84 { return DataInfo(this->GetTypeInfo(),mNature); }
85 /// Returns the name of the type of the in/output
86 virtual std::string GetHumanTypeName() const = 0;
87 /// Returns true iff the type is a pointer to class
88 virtual bool IsPointerType() const = 0;
89 /// Returns true iff the in/output must be copied
90 /// by the copy constructor of the box
91 bool GetCopyConstruct() const { return mCopyConstruct; }
94 /// Default ctor is reserved to children
95 BlackBoxInputOutputDescriptor() : mCreatorTypeInfo(typeid(void)),
96 mName(""), mDescription(""),
102 /// The TypeInfo of the BlackBoxDescriptor which created this descriptor
103 TypeInfo mCreatorTypeInfo;
104 /// The name of the input/output
106 /// The description of the input/output
107 std::string mDescription;
108 /// The nature of the input/output
110 /// Does the in/output has to be copied by copy constructor
111 /// default = true. Must be set to false if it is
112 /// initialized by the user in bbUserCopyConstructor
113 /// (typically if it is a pointer)