]> Creatis software - bbtk.git/blob - kernel/src/bbtkAtomicBlackBoxInputDescriptor.h
a44c420c8df708163414f521e2b9153e38752b0f
[bbtk.git] / kernel / src / bbtkAtomicBlackBoxInputDescriptor.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkAtomicBlackBoxInputDescriptor.h,v $
5   Language:  C++
6   Date:      $Date: 2008/02/07 11:06:37 $
7   Version:   $Revision: 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::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                                  AtomicBlackBoxGetFunctor* getfunctor,
53                                  AtomicBlackBoxSetFunctor* setfunctor,
54                                  bool copy_construct = true);
55
56     ~AtomicBlackBoxInputDescriptor();  
57     /// Returns the type of the input
58     TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); }
59     /// Returns the name of the type of the input
60     std::string GetTypeName() const { return mGetFunctor->GetTypeName(); }
61     /// Returns the name of the type of the input
62     std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); }    
63     /// Returns true iff the type is a pointer to class 
64     virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); }    
65     /// Returns the functor on the Get method
66     AtomicBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; }
67     /// Returns the functor on the Set method
68     AtomicBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; }
69     
70     
71   private:
72     /// Default ctor is private 
73     AtomicBlackBoxInputDescriptor() : 
74       BlackBoxInputDescriptor(typeid(void),"","") {}
75     /// The functor on the Get method
76     AtomicBlackBoxGetFunctor* mGetFunctor;
77     /// The functor on the Set method
78     AtomicBlackBoxSetFunctor* mSetFunctor;
79   };
80   
81 }
82 // namespace bbtk
83 #endif