]> Creatis software - bbtk.git/blob - packages/std/src/bbstdRelay.h
c0ef92d0ab181cb5922c4e10aa8dad484737297a
[bbtk.git] / packages / std / src / bbstdRelay.h
1 #ifndef __bbstdRelay_h_INCLUDED_H__
2 #define __bbstdRelay_h_INCLUDED_H__
3
4 #include "bbtkAtomicBlackBox.h"
5
6 namespace bbstd
7 {
8   //=======================================================================
9   template <class T>
10   class Relay
11     :
12     public bbtk::AtomicBlackBox
13   {
14     BBTK_TEMPLATE_BLACK_BOX_INTERFACE(Relay,bbtk::AtomicBlackBox,T);
15     BBTK_DECLARE_INPUT(In,T);
16     BBTK_DECLARE_OUTPUT(Out,T);
17     BBTK_PROCESS(Process);
18   protected:
19     void Process() { bbSetOutputOut ( bbGetInputIn() ); }
20   };
21   //=======================================================================
22
23   //=======================================================================
24   BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(Relay,bbtk::AtomicBlackBox);
25   BBTK_NAME(bbtk::HumanTypeName<T>()+"Relay");
26   BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
27   BBTK_CATEGORY("misc");
28   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.");
29   BBTK_TEMPLATE_INPUT(Relay,In,"Input",T);
30   BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T);
31   BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay);
32   //=======================================================================
33
34 }
35 // namespace bbstd
36
37 #endif // __bbstdRelay_h_INCLUDED_H__