OpenWalnut  1.4.0
WModuleCombinerTypes.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WMODULECOMBINERTYPES_H
00026 #define WMODULECOMBINERTYPES_H
00027 
00028 #include <string>
00029 #include <utility>
00030 #include <vector>
00031 
00032 #include <boost/shared_ptr.hpp>
00033 
00034 
00035 
00036 class WModule;
00037 class WModuleOneToOneCombiner;
00038 
00039 namespace WCombinerTypes
00040 {
00041     /**
00042      * A list of all combiners in a group.
00043      */
00044     typedef std::vector< boost::shared_ptr< WModuleOneToOneCombiner > > WOneToOneCombiners;
00045 
00046     /**
00047      * A group of compatible connections to and from a specified module, which is additionally stored in the first element of the pair. This first
00048      * element will never be the module to which the compatible connections have been searched for.
00049      */
00050     typedef std::pair< boost::shared_ptr< WModule >, WOneToOneCombiners > WCompatiblesGroup;
00051 
00052     /**
00053      * This is a list of compatible connection groups, which has been created for a specific module.
00054      */
00055     typedef std::vector< WCompatiblesGroup > WCompatiblesList;
00056 
00057     /**
00058      * A  pair of a connector and WCompatibleCombiners for each connection from/to the connector specified in the first element of the pair.
00059      */
00060     typedef std::pair< std::string, WOneToOneCombiners > WDisconnectGroup;
00061 
00062     /**
00063      * A list of all connectors and their possible disconnect- combiner.
00064      */
00065     typedef std::vector< WDisconnectGroup > WDisconnectList;
00066 
00067     /**
00068      * Sorting function for sorting the compatibles list. It uses the alphabetical order of the names.
00069      *
00070      * \param lhs the first combiner
00071      * \param rhs the second combiner
00072      *
00073      * \return true if lhs < rhs
00074      */
00075     bool  compatiblesSort( WCompatiblesGroup lhs, WCompatiblesGroup rhs );
00076 }
00077 
00078 #endif  // WMODULECOMBINERTYPES_H
00079