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