]> Creatis software - bbtk.git/blob - kernel/src/bbtkAtomicBlackBoxInputDescriptor.h
1b02c5159270d20010730bed126541c068d16bed
[bbtk.git] / kernel / src / bbtkAtomicBlackBoxInputDescriptor.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkAtomicBlackBoxInputDescriptor.h,v $
5   Language:  C++
6   Date:      $Date: 2008/04/08 06:59:29 $
7   Version:   $Revision: 1.2 $
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::AtomicBlackBoxInputDescriptor : structure containing the description of a AtomicBlackBox input (name, description, type, functor)
22  */
23 /**
24  * \class bbtk::AtomicBlackBoxInputDescriptor
25  * \brief Structure containing the description of a AtomicBlackBox input (name, description, type, functor)
26  */
27  
28 #ifndef __bbtkAtomicBlackBoxInputDescriptor_h__
29 #define __bbtkAtomicBlackBoxInputDescriptor_h__
30
31 #include "bbtkBlackBoxInputDescriptor.h"
32 #include "bbtkAtomicBlackBoxGetSetFunctor.h"
33 #include <typeinfo>
34
35 namespace bbtk
36 {
37
38
39   class BBTK_EXPORT AtomicBlackBoxInputDescriptor : 
40     public bbtk::BlackBoxInputDescriptor
41   {
42   public:
43     //typedef enum {
44     //  MANDATORY,
45     //  OPTIONAL
46     //} InputType;
47
48       
49     AtomicBlackBoxInputDescriptor( TypeInfo creator_type_info,
50                                    const std::string& name,
51                                    const std::string& description,
52                                    const std::string& nature,
53                                    AtomicBlackBoxGetFunctor* getfunctor,
54                                    AtomicBlackBoxSetFunctor* setfunctor,
55                                    bool copy_construct = true);
56     
57     ~AtomicBlackBoxInputDescriptor();  
58     /// Returns the type of the input
59     TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); }
60     /// Returns the name of the type of the input
61     std::string GetTypeName() const { return mGetFunctor->GetTypeName(); }
62     /// Returns the name of the type of the input
63     std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); }    
64     /// Returns true iff the type is a pointer to class 
65     virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); }    
66     /// Returns the functor on the Get method
67     AtomicBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; }
68     /// Returns the functor on the Set method
69     AtomicBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; }
70     
71     
72   private:
73     /// Default ctor is private 
74     AtomicBlackBoxInputDescriptor() : 
75       BlackBoxInputDescriptor(typeid(void),"","","") {}
76     /// The functor on the Get method
77     AtomicBlackBoxGetFunctor* mGetFunctor;
78     /// The functor on the Set method
79     AtomicBlackBoxSetFunctor* mSetFunctor;
80   };
81   
82 }
83 // namespace bbtk
84 #endif