core/TypeDefs.hpp
Go to the documentation of this file.
00001 /*
00002 
00003   This file is part of OpenFLUID software
00004   Copyright(c) 2007, INRA - Montpellier SupAgro
00005 
00006 
00007  == GNU General Public License Usage ==
00008 
00009   OpenFLUID is free software: you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free Software Foundation, either version 3 of the License, or
00012   (at your option) any later version.
00013 
00014   OpenFLUID is distributed in the hope that it will be useful,
00015   but WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017   GNU General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
00021 
00022 
00023  == Other Usage ==
00024 
00025   Other Usage means a use of OpenFLUID that is inconsistent with the GPL
00026   license, and requires a written agreement between You and INRA.
00027   Licensees for Other Usage of OpenFLUID may use this file in accordance
00028   with the terms contained in the written agreement between You and INRA.
00029   
00030 */
00031 
00032 
00033 
00034 /**
00035   @file
00036 
00037   @author Jean-Christophe FABRE <fabrejc@supagro.inra.fr>
00038 */
00039 
00040 #ifndef __TYPEDEFS_H__
00041 #define __TYPEDEFS_H__
00042 
00043 #include <vector>
00044 #include <list>
00045 #include <map>
00046 #include <openfluid/dllexport.hpp>
00047 #include <openfluid/core/VectorValue.hpp>
00048 #include <openfluid/core/DoubleValue.hpp>
00049 #include <openfluid/core/StringValue.hpp>
00050 
00051 
00052 namespace openfluid { namespace core {
00053 
00054 
00055 
00056 /**
00057   Type definition for the ID of units
00058 */
00059 typedef unsigned int UnitID_t;
00060 
00061 /**
00062   Type definition for the process order of units
00063 */
00064 typedef int PcsOrd_t;
00065 
00066 /**
00067   Type definition for the class of units
00068 */
00069 typedef std::string UnitClass_t;
00070 
00071 /**
00072   Type definition for name of an attribute
00073 */
00074 typedef std::string AttributeName_t;
00075 
00076 /**
00077   Type definition for name of a variable
00078 */
00079 typedef std::string VariableName_t;
00080 
00081 
00082 typedef std::pair<UnitClass_t,UnitID_t> UnitClassID_t;
00083 
00084 typedef std::pair<UnitClassID_t,UnitClassID_t> UnitsLink_t;
00085 
00086 
00087 /**
00088  Type definition for a serie of DoubleValue
00089  */
00090 typedef std::vector<DoubleValue> SerieOfDoubleValue;
00091 
00092 
00093 /**
00094  Type definition for a serie of VectorValue
00095  */
00096 typedef std::vector<VectorValue> SerieOfVectorValue;
00097 
00098 
00099 // =====================================================================
00100 // =====================================================================
00101 
00102 /**
00103   Generic map container associating a unit ID to data
00104 */
00105 template<class T>
00106 struct IDMap
00107 {
00108   typedef std::map<UnitID_t,T> Type;
00109 };
00110 
00111 
00112 /**
00113   Map associating a float value to a unit ID
00114 */
00115 typedef IDMap<float>::Type IDFloatMap;
00116 
00117 /**
00118   Map associating a double precision value to a unit ID
00119 */
00120 typedef IDMap<double>::Type IDDoubleMap;
00121 
00122 /**
00123   Map associating a DoubleValue value to a unit ID
00124 */
00125 typedef IDMap<DoubleValue>::Type IDDoubleValueMap;
00126 
00127 /**
00128   Map associating an integer value to a unit ID
00129 */
00130 typedef IDMap<int>::Type IDIntMap;
00131 
00132 /**
00133   Map associating a boolean value to a unit ID
00134 */
00135 typedef IDMap<bool>::Type IDBoolMap;
00136 
00137 /**
00138   Map associating an openfluid::core::VectorValue value to a unit ID
00139 */
00140 typedef IDMap<VectorValue>::Type IDVectorValueMap;
00141 
00142 /**
00143   Map associating a pointer to an openfluid::core::VectorValue value to a unit ID
00144 */
00145 typedef IDMap<VectorValue*>::Type IDVectorValuePtrMap;
00146 
00147 typedef IDMap<SerieOfDoubleValue>::Type IDSerieOfDoubleValueMap;
00148 
00149 typedef IDMap<SerieOfDoubleValue*>::Type IDSerieOfDoubleValuePtrMap;
00150 
00151 
00152 
00153 
00154 } } // namespaces
00155 
00156 
00157 #endif /*__TYPEDEFS_H__*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines