]> Creatis software - bbtk.git/blob - kernel/src/bbtkBlackBoxOutputDescriptor.h
Recreated the complete cvs tree because the project architecture deeply changed
[bbtk.git] / kernel / src / bbtkBlackBoxOutputDescriptor.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkBlackBoxOutputDescriptor.h,v $
5   Language:  C++
6   Date:      $Date: 2008/01/22 15:02:00 $
7   Version:   $Revision: 1.1.1.1 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 /**
20  *  \file 
21  *  \brief Class bbtk::BlackBoxOutputDescriptor : abstract descriptor of an output of a black box (stores a name, a description and type)
22  */
23 /**
24  * \class bbtk::BlackBoxOutputDescriptor
25  * \brief Abstract descriptor of an output of a black box (stores a name, a description and type)
26  */
27
28 #ifndef __bbtkBlackBoxOutputDescriptor_h__
29 #define __bbtkBlackBoxOutputDescriptor_h__
30
31
32 #include "bbtkSystem.h"
33 #include "bbtkData.h"
34 #include "bbtkRTTI.h"
35
36 namespace bbtk
37 {
38   
39   
40   class BBTK_EXPORT BlackBoxOutputDescriptor
41   {
42   public:
43     /// Ctor with name and description
44     BlackBoxOutputDescriptor( const std::string& name,
45                               const std::string& description,
46                               bool copy_construct = true)
47       : mName(name), mDescription(description), 
48         mCopyConstruct(copy_construct) 
49     {}
50     
51     /// Returns the name of the output
52     const std::string& GetName() const { return mName; }
53     /// Returns the description of the output
54     const std::string& GetDescription() const { return mDescription; }
55     /// Returns the type of the output
56     virtual TypeInfo GetTypeInfo() const = 0;
57     /// Returns the name of the type of the output
58     virtual std::string GetTypeName() const = 0;
59     /// Returns the name of the type of the output
60     virtual std::string GetHumanTypeName() const = 0;
61      /// Returns true iff the type is a pointer to class 
62     virtual bool IsPointerType() const = 0;
63     /// Returns true iff the input must be copied 
64     /// by the copy constructor of the box
65     bool GetCopyConstruct() const { return mCopyConstruct; }
66     
67     
68   private:
69     /// Default ctor is private
70     BlackBoxOutputDescriptor() : mName(""), mDescription("") {}
71     /// The name of the output
72     std::string mName;
73     /// The description of the output
74     std::string mDescription;
75      /// Does the output has to be copied by copy constructor 
76     /// default = true. Must be set to false if it is 
77     /// initialized by the user in bbUserCopyConstructor 
78     /// (typically if it is a pointer)
79     bool mCopyConstruct;
80  };
81   
82 }
83 // namespace bbtk
84 #endif