fluidx/AdvancedModelDescriptor.hpp
Go to the documentation of this file.
00001 /*
00002 
00003   This file is part of OpenFLUID software
00004   Copyright(c) 2007, INRA - Montpellier SupAgro
00005 
00006 
00007  == GNU General Public License Usage ==
00008 
00009   OpenFLUID is free software: you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free Software Foundation, either version 3 of the License, or
00012   (at your option) any later version.
00013 
00014   OpenFLUID is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
00021 
00022 
00023  == Other Usage ==
00024 
00025   Other Usage means a use of OpenFLUID that is inconsistent with the GPL
00026   license, and requires a written agreement between You and INRA.
00027   Licensees for Other Usage of OpenFLUID may use this file in accordance
00028   with the terms contained in the written agreement between You and INRA.
00029   
00030 */
00031 
00032 /**
00033  \file AdvancedModelDescriptor.hpp
00034  \brief Header of ...
00035 
00036  \author Aline LIBRES <aline.libres@gmail.com>
00037  */
00038 
00039 #ifndef ADVANCEDMODELDESCRIPTOR_HPP_
00040 #define ADVANCEDMODELDESCRIPTOR_HPP_
00041 
00042 #include <openfluid/fluidx/CoupledModelDescriptor.hpp>
00043 #include <openfluid/dllexport.hpp>
00044 
00045 
00046 namespace openfluid {
00047 namespace fluidx {
00048 
00049 class DLLEXPORT AdvancedModelDescriptor
00050 {
00051   protected:
00052 
00053     openfluid::fluidx::CoupledModelDescriptor* mp_ModelDesc;
00054 
00055     AdvancedModelDescriptor()
00056     {
00057     }
00058 
00059   public:
00060 
00061     AdvancedModelDescriptor(
00062         openfluid::fluidx::CoupledModelDescriptor& ModelDesc);
00063 
00064     ~AdvancedModelDescriptor();
00065 
00066     void checkModel() const;
00067 
00068     const std::list<openfluid::fluidx::ModelItemDescriptor*>& getItems() const;
00069 
00070     /**
00071      * @throw openfluid::base::OFException if Index is out of range
00072      * @param Index
00073      * @return
00074      */
00075     openfluid::fluidx::ModelItemDescriptor* getItemAt(unsigned int Index) const;
00076 
00077     /**
00078      * Return the position of the firts Item with ItemID found in the list, or -1 if not found
00079      * @param ItemID
00080      * @return
00081      */
00082     int getFirstItemIndex(std::string ItemID) const;
00083 
00084     int getFirstItemIndex(openfluid::fluidx::ModelItemDescriptor* Item) const;
00085 
00086     std::vector<std::string> getOrderedIDs() const;
00087 
00088     std::string getID(openfluid::fluidx::ModelItemDescriptor* Item) const;
00089 
00090     void appendItem(openfluid::fluidx::ModelItemDescriptor* Item);
00091 
00092     /**
00093      Insert an Item before the given position (positions starts at index 0)
00094      @param[in] Item the ModelItemDescriptor to insert
00095      @param[in] Position the position, should be between zero and list size - 1.
00096      To insert an Item at the end of the list, use appendItem instead.
00097      @throw openfluid::base::OFException if Position is out of range
00098      */
00099     void insertItem(openfluid::fluidx::ModelItemDescriptor* Item,
00100                     unsigned int Position);
00101 
00102     /**
00103      * @brief Replace existing simulators with SimulatorsList
00104      */
00105     void setItems(
00106         std::list<openfluid::fluidx::ModelItemDescriptor*> SimulatorsList);
00107 
00108     /**
00109      Remove from the list the Item located at the given Position (positions starts at index 0).
00110      This doesn't delete the ModelItemDescriptor pointer.
00111      @param[in] Position the position
00112      @throw openfluid::base::OFException if Position is out of range
00113      */
00114     void removeItem(unsigned int Position);
00115 
00116     /**
00117      * Move the Item located at the given From position to the To position (positions starts at index 0)
00118      * @param From
00119      * @param To
00120      * @throw openfluid::base::OFException a position is out of range
00121      */
00122     void moveItem(unsigned int From, unsigned int To);
00123 
00124     unsigned int getItemsCount() const;
00125 
00126     void getItemsCount(unsigned int& SimCount, unsigned int& GenCount) const;
00127 
00128     void setGlobalParameter(const openfluid::ware::WareParamKey_t& Key,
00129                             const openfluid::ware::WareParamValue_t& Value);
00130 
00131     void setGlobalParameters(const openfluid::ware::WareParams_t& Params);
00132 
00133     openfluid::ware::WareParams_t getGlobalParameters() const;
00134 
00135     void eraseGlobalParameter(const openfluid::ware::WareParamKey_t& Key);
00136 };
00137 
00138 }
00139 } // namespaces
00140 #endif /* ADVANCEDMODELDESCRIPTOR_HPP_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines