]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdRelay.h
Added MixingVector box.
[bbtk.git] / packages / std / src / bbstdRelay.h
index 676da805fe1fead274b0818bdb6b28451fde4fd2..4d9d7ff0e4ebdf6b0561b9e2d726123021dff496 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbstdRelay.h,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:27 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2009/05/14 14:43:38 $
+  Version:   $Revision: 1.10 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 #define __bbstdRelay_h_INCLUDED_H__
 
 #include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
 
 namespace bbstd
 {
   //=======================================================================
   template <class T>
-  class Relay
+  class bbstd_EXPORT Relay
     :
   public bbtk::AtomicBlackBox
   {
@@ -62,7 +63,34 @@ namespace bbstd
   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay);
   //=======================================================================
 
+  template <class T> void Relay<T>::bbUserSetDefaultValues() {}
+  template <class T> void Relay<T>::bbUserInitializeProcessing() {}
+  template <class T> void Relay<T>::bbUserFinalizeProcessing() {}
+
 }
 // namespace bbstd
 
+//=======================================================================
+// MACRO
+
+#define BBTK_DEFINE_RELAY_BLACK_BOX(TYPE,PACKAGE,NAME) \
+class bb ## PACKAGE ## _EXPORT NAME : public bbtk::AtomicBlackBox { \
+  BBTK_BLACK_BOX_INTERFACE(NAME,bbtk::AtomicBlackBox); \
+  BBTK_DECLARE_INPUT(In,TYPE); \
+  BBTK_DECLARE_OUTPUT(Out,TYPE); \
+  BBTK_PROCESS(Process); \
+ protected: \
+  void Process() { bbSetOutputOut ( bbGetInputIn() ); } \
+}; \
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(NAME,bbtk::AtomicBlackBox);\
+BBTK_NAME(#NAME); \
+BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr"); \
+BBTK_CATEGORY("misc"); \
+BBTK_DESCRIPTION("Just copies the value of its input to its output. Usefull to plug an input of a complex box into different internal boxes."); \
+BBTK_INPUT(NAME,In,"Input",TYPE,"");\
+BBTK_OUTPUT(NAME,Out,"Output",TYPE,"");\
+BBTK_END_DESCRIBE_BLACK_BOX(NAME);
+
+//=======================================================================
+
 #endif // __bbstdRelay_h_INCLUDED_H__