]> Creatis software - bbtk.git/blob - kernel/src/bbtkUserBlackBoxInputDescriptor.h
Recreated the complete cvs tree because the project architecture deeply changed
[bbtk.git] / kernel / src / bbtkUserBlackBoxInputDescriptor.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbtkUserBlackBoxInputDescriptor.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::UserBlackBoxInputDescriptor : structure containing the description of a UserBlackBox input (name, description, type, functor)
22  */
23 /**
24  * \class bbtk::UserBlackBoxInputDescriptor
25  * \brief Structure containing the description of a UserBlackBox input (name, description, type, functor)
26  */
27  
28 #ifndef __bbtkUserBlackBoxInputDescriptor_h__
29 #define __bbtkUserBlackBoxInputDescriptor_h__
30
31 #include "bbtkBlackBoxInputDescriptor.h"
32 #include "bbtkUserBlackBoxGetSetFunctor.h"
33 #include <typeinfo>
34
35 namespace bbtk
36 {
37
38
39   class BBTK_EXPORT UserBlackBoxInputDescriptor : public bbtk::BlackBoxInputDescriptor
40   {
41   public:
42     //typedef enum {
43     //  MANDATORY,
44     //  OPTIONAL
45     //} InputType;
46
47       
48     UserBlackBoxInputDescriptor( const std::string& name,
49                                  const std::string& description,
50                                  UserBlackBoxGetFunctor* getfunctor,
51                                  UserBlackBoxSetFunctor* setfunctor,
52                                  bool copy_construct = true);
53
54     ~UserBlackBoxInputDescriptor();  
55     /// Returns the type of the input
56     TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); }
57     /// Returns the name of the type of the input
58     std::string GetTypeName() const { return mGetFunctor->GetTypeName(); }
59     /// Returns the name of the type of the input
60     std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); }    
61     /// Returns true iff the type is a pointer to class 
62     virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); }    
63     /// Returns the functor on the Get method
64     UserBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; }
65     /// Returns the functor on the Set method
66     UserBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; }
67     
68     
69   private:
70     /// Default ctor is private 
71     UserBlackBoxInputDescriptor() : BlackBoxInputDescriptor("","") {}
72     /// The functor on the Get method
73     UserBlackBoxGetFunctor* mGetFunctor;
74     /// The functor on the Set method
75     UserBlackBoxSetFunctor* mSetFunctor;
76   };
77   
78 }
79 // namespace bbtk
80 #endif