TypeDefs.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 
34 /**
35  @file core/TypeDefs.hpp
36 
37  @author Jean-Christophe FABRE <jean-christophe.fabre@supagro.inra.fr>
38 */
39 
40 #ifndef __OPENFLUID_CORE_TYPEDEFS_HPP__
41 #define __OPENFLUID_CORE_TYPEDEFS_HPP__
42 
43 
44 #include <vector>
45 #include <list>
46 #include <map>
47 #include <openfluid/dllexport.hpp>
52 
53 
54 namespace openfluid { namespace core {
55 
56 
57 
58 /**
59  Type definition for the ID of units
60 */
61 typedef unsigned int UnitID_t;
62 
63 /**
64  Type definition for the process order of units
65 */
66 typedef int PcsOrd_t;
67 
68 /**
69  Type definition for the class of units
70 */
71 typedef std::string UnitsClass_t;
72 
73 /**
74  @deprecated Since version 2.1.0. Use openfluid::core::UnitsClass_t instead
75 */
76 typedef UnitsClass_t UnitClass_t OPENFLUID_DEPRECATED;
77 
78 /**
79  Type definition for name of an attribute
80 */
81 typedef std::string AttributeName_t;
82 
83 /**
84  Type definition for name of a variable
85 */
86 typedef std::string VariableName_t;
87 
88 /**
89  Type definition for a pair containing the unit class and the unit ID
90 */
91 typedef std::pair<UnitsClass_t,UnitID_t> UnitClassID_t;
92 
93 /**
94  Type definition for a link between two units defined by their class and ID
95 */
96 typedef std::pair<UnitClassID_t,UnitClassID_t> UnitsLink_t;
97 
98 
99 /**
100  Type definition for a serie of DoubleValue
101  */
102 typedef std::vector<DoubleValue> SerieOfDoubleValue;
103 
104 
105 /**
106  Type definition for a serie of VectorValue
107  */
108 typedef std::vector<VectorValue> SerieOfVectorValue;
109 
110 
111 // =====================================================================
112 // =====================================================================
113 
114 /**
115  Generic map container associating a unit ID to data
116 */
117 template<class T>
118 struct IDMap
119 {
120  typedef std::map<UnitID_t,T> Type;
121 };
122 
123 
124 /**
125  Map associating a float value to a unit ID
126 */
128 
129 /**
130  Map associating a double precision value to a unit ID
131 */
133 
134 /**
135  Map associating a DoubleValue value to a unit ID
136 */
138 
139 /**
140  Map associating an integer value to a unit ID
141 */
143 
144 /**
145  Map associating a boolean value to a unit ID
146 */
148 
149 /**
150  Map associating an openfluid::core::VectorValue value to a unit ID
151 */
153 
154 /**
155  Map associating a pointer to an openfluid::core::VectorValue value to a unit ID
156 */
158 
160 
162 
163 
164 
165 
166 } } // namespaces
167 
168 
169 #endif /* __OPENFLUID_CORE_TYPEDEFS_HPP__ */
IDMap< SerieOfDoubleValue * >::Type IDSerieOfDoubleValuePtrMap
Definition: TypeDefs.hpp:161
IDMap< SerieOfDoubleValue >::Type IDSerieOfDoubleValueMap
Definition: TypeDefs.hpp:159
std::string UnitsClass_t
Definition: TypeDefs.hpp:71
std::string VariableName_t
Definition: TypeDefs.hpp:86
IDMap< double >::Type IDDoubleMap
Definition: TypeDefs.hpp:132
SpatialUnit Unit OPENFLUID_DEPRECATED
Definition: SpatialUnit.hpp:304
IDMap< int >::Type IDIntMap
Definition: TypeDefs.hpp:142
IDMap< VectorValue >::Type IDVectorValueMap
Definition: TypeDefs.hpp:152
std::map< UnitID_t, T > Type
Definition: TypeDefs.hpp:120
IDMap< float >::Type IDFloatMap
Definition: TypeDefs.hpp:127
Definition: ApplicationException.hpp:47
IDMap< bool >::Type IDBoolMap
Definition: TypeDefs.hpp:147
IDMap< DoubleValue >::Type IDDoubleValueMap
Definition: TypeDefs.hpp:137
std::vector< DoubleValue > SerieOfDoubleValue
Definition: TypeDefs.hpp:102
std::string AttributeName_t
Definition: TypeDefs.hpp:81
std::pair< UnitClassID_t, UnitClassID_t > UnitsLink_t
Definition: TypeDefs.hpp:96
std::vector< VectorValue > SerieOfVectorValue
Definition: TypeDefs.hpp:108
int PcsOrd_t
Definition: TypeDefs.hpp:66
Definition: TypeDefs.hpp:118
std::pair< UnitsClass_t, UnitID_t > UnitClassID_t
Definition: TypeDefs.hpp:91
IDMap< VectorValue * >::Type IDVectorValuePtrMap
Definition: TypeDefs.hpp:157
unsigned int UnitID_t
Definition: TypeDefs.hpp:61