OpenWalnut  1.5.0dev
WModuleCombinerTypes.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 WMODULECOMBINERTYPES_H
26 #define WMODULECOMBINERTYPES_H
27 
28 #include <memory>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 
34 
35 
36 class WModule;
38 
39 namespace WCombinerTypes
40 {
41  /**
42  * A list of all combiners in a group.
43  */
44  typedef std::vector< std::shared_ptr< WModuleOneToOneCombiner > > WOneToOneCombiners;
45 
46  /**
47  * A group of compatible connections to and from a specified module, which is additionally stored in the first element of the pair. This first
48  * element will never be the module to which the compatible connections have been searched for.
49  */
50  typedef std::pair< std::shared_ptr< WModule >, WOneToOneCombiners > WCompatiblesGroup;
51 
52  /**
53  * This is a list of compatible connection groups, which has been created for a specific module.
54  */
55  typedef std::vector< WCompatiblesGroup > WCompatiblesList;
56 
57  /**
58  * A pair of a connector and WCompatibleCombiners for each connection from/to the connector specified in the first element of the pair.
59  */
60  typedef std::pair< std::string, WOneToOneCombiners > WDisconnectGroup;
61 
62  /**
63  * A list of all connectors and their possible disconnect- combiner.
64  */
65  typedef std::vector< WDisconnectGroup > WDisconnectList;
66 
67  /**
68  * Sorting function for sorting the compatibles list. It uses the alphabetical order of the names.
69  *
70  * \param lhs the first combiner
71  * \param rhs the second combiner
72  *
73  * \return true if lhs < rhs
74  */
75  bool compatiblesSort( WCompatiblesGroup lhs, WCompatiblesGroup rhs );
76 }
77 
78 #endif // WMODULECOMBINERTYPES_H
79 
Base class for all combiners which apply one connection between two connectors of two modules.
Class representing a single module of OpenWalnut.
Definition: WModule.h:72