]> Creatis software - bbtk.git/blob - kernel/src/bbtkAtomicBlackBoxDescriptor.cxx
e31cca495e38a833b13c66deb529b07904ebba2b
[bbtk.git] / kernel / src / bbtkAtomicBlackBoxDescriptor.cxx
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbtkAtomicBlackBoxDescriptor.cxx,v $
4   Language:  C++
5   Date:      $Date: 2012/07/26 08:28:31 $
6   Version:   $Revision: 1.5 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31 #include "bbtkAtomicBlackBoxDescriptor.h"
32 #include "bbtkBlackBox.h"
33 #include "bbtkPackage.h"
34 #define bbtkDMessage(key,level,mess) \
35   bbtkMessage(key,level,"["<<GetFullTypeName()<<"] "<<mess)
36 #define bbtkDDebugMessage(key,level,mess)       \
37   bbtkDebugMessage(key,level,"["<<GetFullTypeName()<<"] "<<mess)
38
39 namespace bbtk
40 {
41   AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor() 
42   {  
43     bbtkDDebugMessage("object",3,"==> AtomicBlackBoxDescriptor()"<<std::endl);
44     // Creates the input 'BoxProcessMode'
45     AddInputDescriptor
46       (new 
47        bbtk::AtomicBlackBoxInputDescriptor
48        (typeid(AtomicBlackBoxDescriptor),
49         "BoxProcessMode",
50         "Sets the processing mode of the box (Pipeline | Always | Reactive | Manual)",
51         "",
52         new bbtk::AtomicBlackBoxTGetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbGetInputBoxProcessMode), 
53         new bbtk::AtomicBlackBoxTSetFunctor<BlackBox,std::string,std::string>(&BlackBox::bbSetInputBoxProcessMode) ) );
54     // Creates the input 'BoxExecute'
55     AddInputDescriptor
56       (new
57        bbtk::AtomicBlackBoxInputDescriptor
58        (typeid(AtomicBlackBoxDescriptor),
59         "BoxExecute",
60         "Any signal received by this input executes the box",
61         "signal",
62         new bbtk::AtomicBlackBoxTGetFunctor<BlackBox,Void,Void>(&BlackBox::bbGetInputBoxExecute), 
63         new bbtk::AtomicBlackBoxTSetFunctor<BlackBox,Void,Void>(&BlackBox::bbSetInputBoxExecute) ) );
64     // Creates the output 'BoxChange'      
65     AddOutputDescriptor
66       (new 
67        bbtk::AtomicBlackBoxOutputDescriptor
68        (typeid(AtomicBlackBoxDescriptor),
69         "BoxChange",
70         "Signals modifications of the box", 
71         "signal",
72         new bbtk::AtomicBlackBoxTGetFunctor<BlackBox,Void,Void>(&BlackBox::bbGetOutputBoxChange), 
73         new bbtk::AtomicBlackBoxTSetFunctor<BlackBox,Void,Void>(&BlackBox::bbSetOutputBoxChange) ) );
74     //
75     AddToCategory("atomic box");
76     bbtkDDebugMessage("object",3,"<== AtomicBlackBoxDescriptor()"<<std::endl);
77   }
78   //===================================================================
79
80   AtomicBlackBoxDescriptor::~AtomicBlackBoxDescriptor() 
81   {  
82     bbtkDDebugMessage("object",3,"==> ~AtomicBlackBoxDescriptor()"<<std::endl);
83   }
84 }// namespace bbtk