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 #include <boost/shared_ptr.hpp>
34 
35 #include "../WModule.h"
36 #include "../WModuleCombinerTypes.h"
37 #include "WModuleOneToOneCombiner.h"
38 
39 #include "../WModuleConnector.h"
40 
41 
42 
43 /**
44  * Combiner which disconnects the specified connection.
45  */
47 {
48 public:
49  /**
50  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
51  *
52  * \param target the target container
53  * \param srcModule the module whose connector should be disconnected
54  * \param srcConnector the srcModule connector to disconnect
55  * \param targetModule the module whose connector should be disconnected from srcConnector
56  * \param targetConnector the targetModule connector to disconnect.
57  */
58  WDisconnectCombiner( boost::shared_ptr< WModuleContainer > target,
59  boost::shared_ptr< WModule > srcModule, std::string srcConnector,
60  boost::shared_ptr< WModule > targetModule, std::string targetConnector );
61 
62  /**
63  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
64  *
65  * \param srcModule the module whose connector should be disconnected
66  * \param srcConnector the srcModule connector to disconnect
67  * \param targetModule the module whose connector should be disconnected from srcConnector
68  * \param targetConnector the targetModule connector to disconnect.
69  */
70  WDisconnectCombiner( boost::shared_ptr< WModule > srcModule, std::string srcConnector,
71  boost::shared_ptr< WModule > targetModule, std::string targetConnector );
72 
73  /**
74  * Creates a combiner which disconnects the specified connection. If the specified connection does not exist (anymore), nothing will happen.
75  *
76  * \param srcConnector connector 1
77  * \param targetConnector connector 2
78  */
79  WDisconnectCombiner( boost::shared_ptr< WModuleConnector > srcConnector,
80  boost::shared_ptr< WModuleConnector > targetConnector );
81 
82  /**
83  * Destructor.
84  */
85  virtual ~WDisconnectCombiner();
86 
87  /**
88  * Disconnects the specified connection.
89  */
90  virtual void apply();
91 
92 protected:
93 private:
94 };
95 
96 #endif // WDISCONNECTCOMBINER_H
97 
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.