WareSetDescriptor.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 WareSetDescriptor.hpp
34 
35  @author Jean-Christophe Fabre <jean-christophe.fabre@supagro.inra.fr>
36  */
37 
38 
39 #ifndef __OPENFLUID_FLUIDX_WARESETDESCRIPTOR_HPP__
40 #define __OPENFLUID_FLUIDX_WARESETDESCRIPTOR_HPP__
41 
42 
43 #include <list>
45 #include <openfluid/dllexport.hpp>
46 
47 
48 namespace openfluid { namespace fluidx {
49 
50 
51 template<class T>
53 {
54  public:
55 
56  typedef std::list<T*> SetDescription_t;
57 
58 
59  private:
60 
61  SetDescription_t m_SetDescription;
62 
64 
65 
66  public:
67 
69  { }
70 
71 
72  // =====================================================================
73  // =====================================================================
74 
75 
76  inline SetDescription_t& items()
77  {
78  return (m_SetDescription);
79  }
80 
81 
82  // =====================================================================
83  // =====================================================================
84 
85 
86  inline const SetDescription_t& items() const
87  {
88  return (m_SetDescription);
89  }
90 
91 
92  // =====================================================================
93  // =====================================================================
94 
95 
98  {
99  m_Params[Key] = Value;
100  }
101 
102 
103  // =====================================================================
104  // =====================================================================
105 
106 
108  {
109  openfluid::ware::WareParams_t::const_iterator it;
110 
111  for (it=Params.begin();it!=Params.end();++it)
112  m_Params[it->first] = it->second;
113  }
114 
115 
116  // =====================================================================
117  // =====================================================================
118 
119 
121  {
122  return m_Params;
123  }
124 
125 
126  // =====================================================================
127  // =====================================================================
128 
129 
131  {
132  m_Params.erase(Key);
133  }
134 
135 
136  // =====================================================================
137  // =====================================================================
138 
139 
140  void appendItem(T *Item)
141  {
142  m_SetDescription.push_back(Item);
143  }
144 
145 };
146 
147 
148 } } // namespaces
149 
150 
151 #endif /* __OPENFLUID_FLUIDX_MODELDESCRIPTOR_HPP__ */
void appendItem(T *Item)
Definition: WareSetDescriptor.hpp:140
void eraseGlobalParameter(const openfluid::ware::WareParamKey_t &Key)
Definition: WareSetDescriptor.hpp:130
Definition: StringValue.hpp:91
void setGlobalParameters(const openfluid::ware::WareParams_t &Params)
Definition: WareSetDescriptor.hpp:107
#define OPENFLUID_API
Definition: dllexport.hpp:87
SetDescription_t & items()
Definition: WareSetDescriptor.hpp:76
Definition: WareSetDescriptor.hpp:52
std::list< T * > SetDescription_t
Definition: WareSetDescriptor.hpp:56
const SetDescription_t & items() const
Definition: WareSetDescriptor.hpp:86
Definition: ApplicationException.hpp:47
std::string WareParamKey_t
Definition: TypeDefs.hpp:126
openfluid::ware::WareParams_t getGlobalParameters() const
Definition: WareSetDescriptor.hpp:120
void setGlobalParameter(const openfluid::ware::WareParamKey_t &Key, const openfluid::ware::WareParamValue_t &Value)
Definition: WareSetDescriptor.hpp:96
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:130