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