OpenWalnut  1.4.0
WDisconnectCombiner.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WDISCONNECTCOMBINER_H
26 #define WDISCONNECTCOMBINER_H
27 
28 #include <list>
29 #include <map>
30 #include <string>
31 #include <utility>
32 
33 #ifndef Q_MOC_RUN
34 #include <boost/shared_ptr.hpp>
35 #endif
36 
37 #include "../WModule.h"
38 #include "../WModuleCombinerTypes.h"
39 #include "WModuleOneToOneCombiner.h"
40 
41 #include "../WModuleConnector.h"
42 
43 
44 
45 /**
46  * Combiner which disconnects the specified connection.
47  */
49 {
50 public:
51  /**
52  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
53  *
54  * \param target the target container
55  * \param srcModule the module whose connector should be disconnected
56  * \param srcConnector the srcModule connector to disconnect
57  * \param targetModule the module whose connector should be disconnected from srcConnector
58  * \param targetConnector the targetModule connector to disconnect.
59  */
60  WDisconnectCombiner( boost::shared_ptr< WModuleContainer > target,
61  boost::shared_ptr< WModule > srcModule, std::string srcConnector,
62  boost::shared_ptr< WModule > targetModule, std::string targetConnector );
63 
64  /**
65  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
66  *
67  * \param srcModule the module whose connector should be disconnected
68  * \param srcConnector the srcModule connector to disconnect
69  * \param targetModule the module whose connector should be disconnected from srcConnector
70  * \param targetConnector the targetModule connector to disconnect.
71  */
72  WDisconnectCombiner( boost::shared_ptr< WModule > srcModule, std::string srcConnector,
73  boost::shared_ptr< WModule > targetModule, std::string targetConnector );
74 
75  /**
76  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
77  *
78  * \param srcConnector connector 1
79  * \param targetConnector connector 2
80  */
81  WDisconnectCombiner( boost::shared_ptr< WModuleConnector > srcConnector,
82  boost::shared_ptr< WModuleConnector > targetConnector );
83 
84  /**
85  * Destructor.
86  */
87  virtual ~WDisconnectCombiner();
88 
89  /**
90  * Disconnects the specified connection.
91  */
92  virtual void apply();
93 
94 protected:
95 private:
96 };
97 
98 #endif // WDISCONNECTCOMBINER_H
99 
virtual void apply()
Disconnects the specified connection.
WDisconnectCombiner(boost::shared_ptr< WModuleContainer > target, boost::shared_ptr< WModule > srcModule, std::string srcConnector, boost::shared_ptr< WModule > targetModule, std::string targetConnector)
Creates a combiner which disconnects the specified connection.
virtual ~WDisconnectCombiner()
Destructor.
Base class for all combiners which apply one connection between two connectors of two modules...
Combiner which disconnects the specified connection.