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