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@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 
77  {
78  // TODO Manage deletion of items, in relation with advanced descriptors
79  }
80 
81 
82  // =====================================================================
83  // =====================================================================
84 
85 
86  inline SetDescription_t& items()
87  {
88  return (m_SetDescription);
89  }
90 
91 
92  // =====================================================================
93  // =====================================================================
94 
95 
96  inline const SetDescription_t& items() const
97  {
98  return (m_SetDescription);
99  }
100 
101 
102  // =====================================================================
103  // =====================================================================
104 
105 
108  {
109  m_Params[Key] = Value;
110  }
111 
112 
113  // =====================================================================
114  // =====================================================================
115 
116 
118  {
119  openfluid::ware::WareParams_t::const_iterator it;
120 
121  for (it=Params.begin();it!=Params.end();++it)
122  m_Params[it->first] = it->second;
123  }
124 
125 
126  // =====================================================================
127  // =====================================================================
128 
129 
131  {
132  return m_Params;
133  }
134 
135 
136  // =====================================================================
137  // =====================================================================
138 
139 
141  {
142  m_Params.erase(Key);
143  }
144 
145 
146  // =====================================================================
147  // =====================================================================
148 
149 
150  void appendItem(T *Item)
151  {
152  m_SetDescription.push_back(Item);
153  }
154 
155 };
156 
157 
158 } } // namespaces
159 
160 
161 #endif /* __OPENFLUID_FLUIDX_MODELDESCRIPTOR_HPP__ */
void eraseGlobalParameter(const openfluid::ware::WareParamKey_t &Key)
Definition: WareSetDescriptor.hpp:140
void setGlobalParameter(const openfluid::ware::WareParamKey_t &Key, const openfluid::ware::WareParamValue_t &Value)
Definition: WareSetDescriptor.hpp:106
Definition: WareSetDescriptor.hpp:52
openfluid::ware::WareParams_t getGlobalParameters() const
Definition: WareSetDescriptor.hpp:130
Definition: StringValue.hpp:91
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: ApplicationException.hpp:47
std::string WareParamKey_t
Definition: TypeDefs.hpp:126
std::list< T * > SetDescription_t
Definition: WareSetDescriptor.hpp:56
void appendItem(T *Item)
Definition: WareSetDescriptor.hpp:150
SetDescription_t & items()
Definition: WareSetDescriptor.hpp:86
std::map< WareParamKey_t, WareParamValue_t > WareParams_t
Definition: TypeDefs.hpp:130
const SetDescription_t & items() const
Definition: WareSetDescriptor.hpp:96
void setGlobalParameters(const openfluid::ware::WareParams_t &Params)
Definition: WareSetDescriptor.hpp:117