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