2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
30 Module: $RCSfile: bbtkBlackBoxOutputConnector.h,v $
32 Date: $Date: 2012/11/16 08:49:01 $
33 Version: $Revision: 1.11 $
34 =========================================================================*/
41 * \brief Class bbtk::BlackBoxOutputConnector :
44 * \class bbtk::BlackBoxOutputConnector
48 #ifndef __bbtkBlackBoxOutputConnector_h__
49 #define __bbtkBlackBoxOutputConnector_h__
51 #include "bbtkPimpl.h"
52 #include "bbtkConnection.h"
53 #include "bbtkBlackBox.h"
54 #include "bbtkMessageManager.h"
62 class BBTK_EXPORT BlackBoxOutputConnector
67 typedef BlackBox::OutputChangeCallbackType OutputChangeCallbackType;
70 BlackBoxOutputConnector(BlackBoxPointer b);
72 ~BlackBoxOutputConnector();
75 void SetConnection(Connection* c);
76 /// Unsets the connection
77 void UnsetConnection(Connection* c);
78 /// The type of vector of output connections
79 typedef std::vector<Connection*> ConnectionVector;
80 /// Returns the vector of connection plugged into this output (const)
81 const ConnectionVector& GetConnectionVector() const;
83 /// Returns the status of the input
84 IOStatus GetStatus() const;
85 /// Sets the status of the input
86 void SetStatus( IOStatus s );
88 /// Signals the change observers that the output has changed
89 void SignalChange( BlackBox::Pointer box, const std::string& output );
92 /// Adds the function f to the list of functions to call when
93 /// the output changes.
94 void AddChangeObserver(OutputChangeCallbackType f);
96 /// Removes the function f from the list of functions to call when
97 /// the output changes (TO WRITE)
98 void RemoveChangeObserver(OutputChangeCallbackType f);
100 /// Private implementation
101 BBTK_DECLARE_PIMPL(BlackBoxOutputConnector);
104 /// Purposedly not implemented
105 BlackBoxOutputConnector(const BlackBoxOutputConnector&);