All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AdvancedModelDescriptor.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 /**
33  \file AdvancedModelDescriptor.hpp
34  \brief Header of ...
35 
36  \author Aline LIBRES <aline.libres@gmail.com>
37  */
38 
39 #ifndef ADVANCEDMODELDESCRIPTOR_HPP_
40 #define ADVANCEDMODELDESCRIPTOR_HPP_
41 
43 #include <openfluid/dllexport.hpp>
44 
45 
46 namespace openfluid {
47 namespace fluidx {
48 
50 {
51  protected:
52 
54 
56  {
57  }
58 
59  public:
60 
63 
65 
66  void checkModel() const;
67 
68  const std::list<openfluid::fluidx::ModelItemDescriptor*>& getItems() const;
69 
70  /**
71  * @throw openfluid::base::OFException if Index is out of range
72  * @param Index
73  * @return
74  */
75  openfluid::fluidx::ModelItemDescriptor* getItemAt(unsigned int Index) const;
76 
77  /**
78  * Return the position of the firts Item with ItemID found in the list, or -1 if not found
79  * @param ItemID
80  * @return
81  */
82  int getFirstItemIndex(std::string ItemID) const;
83 
84  int getFirstItemIndex(openfluid::fluidx::ModelItemDescriptor* Item) const;
85 
86  std::vector<std::string> getOrderedIDs() const;
87 
88  std::string getID(openfluid::fluidx::ModelItemDescriptor* Item) const;
89 
90  void appendItem(openfluid::fluidx::ModelItemDescriptor* Item);
91 
92  /**
93  Insert an Item before the given position (positions starts at index 0)
94  @param[in] Item the ModelItemDescriptor to insert
95  @param[in] Position the position, should be between zero and list size - 1.
96  To insert an Item at the end of the list, use appendItem instead.
97  @throw openfluid::base::OFException if Position is out of range
98  */
99  void insertItem(openfluid::fluidx::ModelItemDescriptor* Item,
100  unsigned int Position);
101 
102  /**
103  * @brief Replace existing simulators with SimulatorsList
104  */
105  void setItems(
106  std::list<openfluid::fluidx::ModelItemDescriptor*> SimulatorsList);
107 
108  /**
109  Remove from the list the Item located at the given Position (positions starts at index 0).
110  This doesn't delete the ModelItemDescriptor pointer.
111  @param[in] Position the position
112  @throw openfluid::base::OFException if Position is out of range
113  */
114  void removeItem(unsigned int Position);
115 
116  /**
117  * Move the Item located at the given From position to the To position (positions starts at index 0)
118  * @param From
119  * @param To
120  * @throw openfluid::base::OFException a position is out of range
121  */
122  void moveItem(unsigned int From, unsigned int To);
123 
124  unsigned int getItemsCount() const;
125 
126  void getItemsCount(unsigned int& SimCount, unsigned int& GenCount) const;
127 
128  void setGlobalParameter(const openfluid::ware::WareParamKey_t& Key,
129  const openfluid::ware::WareParamValue_t& Value);
130 
131  void setGlobalParameters(const openfluid::ware::WareParams_t& Params);
132 
133  openfluid::ware::WareParams_t getGlobalParameters() const;
134 
135  void eraseGlobalParameter(const openfluid::ware::WareParamKey_t& Key);
136 };
137 
138 }
139 } // namespaces
140 #endif /* ADVANCEDMODELDESCRIPTOR_HPP_ */
openfluid::fluidx::CoupledModelDescriptor * mp_ModelDesc
Definition: AdvancedModelDescriptor.hpp:53
Definition: StringValue.hpp:91
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: PluggableWare.hpp:82
Definition: AdvancedModelDescriptor.hpp:49
DLLEXPORT WareSetDescriptor< ModelItemDescriptor > CoupledModelDescriptor
Definition: CoupledModelDescriptor.hpp:51
AdvancedModelDescriptor()
Definition: AdvancedModelDescriptor.hpp:55
std::string WareParamKey_t
Definition: PluggableWare.hpp:79
Definition: ModelItemDescriptor.hpp:51
#define DLLEXPORT
Definition: dllexport.hpp:51