]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkAtomicBlackBoxInputDescriptor.h
*** empty log message ***
[bbtk.git] / kernel / src / bbtkAtomicBlackBoxInputDescriptor.h
diff --git a/kernel/src/bbtkAtomicBlackBoxInputDescriptor.h b/kernel/src/bbtkAtomicBlackBoxInputDescriptor.h
new file mode 100644 (file)
index 0000000..a44c420
--- /dev/null
@@ -0,0 +1,83 @@
+/*=========================================================================
+                                                                                
+  Program:   bbtk
+  Module:    $RCSfile: bbtkAtomicBlackBoxInputDescriptor.h,v $
+  Language:  C++
+  Date:      $Date: 2008/02/07 11:06:37 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
+/**
+ *  \file 
+ *  \brief Class bbtk::AtomicBlackBoxInputDescriptor : structure containing the description of a AtomicBlackBox input (name, description, type, functor)
+ */
+/**
+ * \class bbtk::AtomicBlackBoxInputDescriptor
+ * \brief Structure containing the description of a AtomicBlackBox input (name, description, type, functor)
+ */
+#ifndef __bbtkAtomicBlackBoxInputDescriptor_h__
+#define __bbtkAtomicBlackBoxInputDescriptor_h__
+
+#include "bbtkBlackBoxInputDescriptor.h"
+#include "bbtkAtomicBlackBoxGetSetFunctor.h"
+#include <typeinfo>
+
+namespace bbtk
+{
+
+
+  class BBTK_EXPORT AtomicBlackBoxInputDescriptor : 
+    public bbtk::BlackBoxInputDescriptor
+  {
+  public:
+    //typedef enum {
+    //  MANDATORY,
+    //  OPTIONAL
+    //} InputType;
+
+      
+    AtomicBlackBoxInputDescriptor( TypeInfo creator_type_info,
+                                const std::string& name,
+                                const std::string& description,
+                                AtomicBlackBoxGetFunctor* getfunctor,
+                                AtomicBlackBoxSetFunctor* setfunctor,
+                                bool copy_construct = true);
+
+    ~AtomicBlackBoxInputDescriptor();  
+    /// Returns the type of the input
+    TypeInfo GetTypeInfo() const { return mGetFunctor->GetTypeInfo(); }
+    /// Returns the name of the type of the input
+    std::string GetTypeName() const { return mGetFunctor->GetTypeName(); }
+    /// Returns the name of the type of the input
+    std::string GetHumanTypeName() const { return mGetFunctor->GetHumanTypeName(); }    
+    /// Returns true iff the type is a pointer to class 
+    virtual bool IsPointerType() const { return mGetFunctor->IsPointerType(); }    
+    /// Returns the functor on the Get method
+    AtomicBlackBoxGetFunctor* GetGetFunctor() { return mGetFunctor; }
+    /// Returns the functor on the Set method
+    AtomicBlackBoxSetFunctor* GetSetFunctor() { return mSetFunctor; }
+    
+    
+  private:
+    /// Default ctor is private 
+    AtomicBlackBoxInputDescriptor() : 
+      BlackBoxInputDescriptor(typeid(void),"","") {}
+    /// The functor on the Get method
+    AtomicBlackBoxGetFunctor* mGetFunctor;
+    /// The functor on the Set method
+    AtomicBlackBoxSetFunctor* mSetFunctor;
+  };
+  
+}
+// namespace bbtk
+#endif