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  @file core/TypeDefs.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
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 <cstdint>
48 
49 #include <openfluid/dllexport.hpp>
53 
54 
55 namespace openfluid { namespace core {
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 [[deprecated]] typedef UnitsClass_t UnitClass_t;
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 // =====================================================================
101 
102 
103 /**
104  Type definition for a serie of DoubleValue
105  */
106 typedef std::vector<DoubleValue> SerieOfDoubleValue;
107 
108 
109 /**
110  Type definition for a serie of VectorValue
111  */
112 typedef std::vector<VectorValue> SerieOfVectorValue;
113 
114 
115 // =====================================================================
116 // =====================================================================
117 
118 
119 /**
120  Generic map container associating a unit ID to data
121 */
122 template<class T>
123 struct IDMap
124 {
125  typedef std::map<UnitID_t,T> Type;
126 };
127 
128 
129 /**
130  Map associating a float value to a unit ID
131 */
133 
134 /**
135  Map associating a double precision value to a unit ID
136 */
138 
139 /**
140  Map associating a DoubleValue value to a unit ID
141 */
143 
144 /**
145  Map associating an integer value to a unit ID
146 */
148 
149 /**
150  Map associating a boolean value to a unit ID
151 */
153 
154 /**
155  Map associating an openfluid::core::VectorValue value to a unit ID
156 */
158 
159 /**
160  Map associating a pointer to an openfluid::core::VectorValue value to a unit ID
161 */
163 
165 
167 
168 
169 // =====================================================================
170 // =====================================================================
171 
172 
173 /**
174  Type for raw time (seconds since 4713BC)
175 */
176 typedef std::uint64_t RawTime_t;
177 
178 /**
179  Type for time indexes (in seconds)
180 */
181 typedef std::uint64_t TimeIndex_t;
182 
183 /**
184  Type for durations (in seconds)
185 */
186 typedef std::uint64_t Duration_t;
187 
188 
189 } } // namespaces
190 
191 
192 #endif /* __OPENFLUID_CORE_TYPEDEFS_HPP__ */
int PcsOrd_t
Definition: TypeDefs.hpp:66
IDMap< double >::Type IDDoubleMap
Definition: TypeDefs.hpp:137
IDMap< float >::Type IDFloatMap
Definition: TypeDefs.hpp:132
std::string AttributeName_t
Definition: TypeDefs.hpp:81
IDMap< int >::Type IDIntMap
Definition: TypeDefs.hpp:147
IDMap< DoubleValue >::Type IDDoubleValueMap
Definition: TypeDefs.hpp:142
Definition: ApplicationException.hpp:47
std::vector< DoubleValue > SerieOfDoubleValue
Definition: TypeDefs.hpp:106
std::string VariableName_t
Definition: TypeDefs.hpp:86
std::string UnitsClass_t
Definition: TypeDefs.hpp:71
std::pair< UnitsClass_t, UnitID_t > UnitClassID_t
Definition: TypeDefs.hpp:91
IDMap< VectorValue >::Type IDVectorValueMap
Definition: TypeDefs.hpp:157
UnitsClass_t UnitClass_t
Definition: TypeDefs.hpp:76
std::pair< UnitClassID_t, UnitClassID_t > UnitsLink_t
Definition: TypeDefs.hpp:96
std::uint64_t TimeIndex_t
Definition: TypeDefs.hpp:181
std::uint64_t Duration_t
Definition: TypeDefs.hpp:186
unsigned int UnitID_t
Definition: TypeDefs.hpp:61
std::uint64_t RawTime_t
Definition: TypeDefs.hpp:176
IDMap< VectorValue * >::Type IDVectorValuePtrMap
Definition: TypeDefs.hpp:162
IDMap< SerieOfDoubleValue * >::Type IDSerieOfDoubleValuePtrMap
Definition: TypeDefs.hpp:166
std::map< UnitID_t, T > Type
Definition: TypeDefs.hpp:125
IDMap< bool >::Type IDBoolMap
Definition: TypeDefs.hpp:152
IDMap< SerieOfDoubleValue >::Type IDSerieOfDoubleValueMap
Definition: TypeDefs.hpp:164
Definition: TypeDefs.hpp:123
std::vector< VectorValue > SerieOfVectorValue
Definition: TypeDefs.hpp:112