Changeset 229 for XMLIO_V2/dev/dev_rv/src4/xmlio/netcdf/inetcdf4.hpp
- Timestamp:
- 06/20/11 13:06:09 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src4/xmlio/netcdf/inetcdf4.hpp
r216 r229 18 18 // M(essage) P(assing) I(nterface) headers 19 19 #include <mpi.h> 20 20 21 21 // NetCDF headers 22 22 #define MPI_INCLUDED 23 23 #include <netcdf.h> 24 24 25 // C++ standard headers 26 # include <vector> 27 28 // boost Headers 29 #include <boost/multi_array.hpp> 30 25 31 #endif // __XIOS_NO_EXTERN 26 32 27 33 // XMLIOServer headers 28 34 #include "xmlioserver_spl.hpp" 35 36 #ifndef UNLIMITED_DIM 37 #define UNLIMITED_DIM (size_t)(-1) 38 #endif //UNLIMITED_DIM 29 39 30 40 // ////////////////////////////// Déclarations ///////////////////////////// // … … 72 82 73 83 //! \brief Destructeur de l'objet (le fichier est clos lors de son appel). 74 ~CINetCDF4(void); 84 virtual ~CINetCDF4(void); 85 86 87 88 public : // Accesseur de parcours (d'exploration) 89 90 std::size_t getNbOfTimestep(void); 91 92 std::string getUnlimitedDimensionName(void); 93 94 std::map<std::string, std::size_t> 95 getDimensions(const std::string * const _varname = NULL); 96 97 std::vector<std::string> getDimensionsIdList (const std::string * _varname); 98 99 std::vector<std::string> getAttributes(const std::string * const _varname = NULL); 100 std::vector<std::string> getGroups (void); 101 std::vector<std::string> getVariables(void); 102 103 public : // Mutateur 104 105 void setCurrentPath(const CNetCDF4Path & _path); 106 107 public : // Accesseurs 108 109 const CNetCDF4Path & getCurrentPath(void) const; 110 111 public : // Lecture 112 113 template <class DataType> 114 void readAttribute 115 (const std::string & _attname, 116 std::vector<DataType> & _value, 117 const std::string * _varname = NULL); 118 119 void readAttribute 120 (const std::string & _attname, 121 std::string & _value, 122 const std::string * _varname = NULL); 123 124 template <class DataType, std::size_t ndim> 125 void readData( boost::multi_array<DataType, ndim> & _data, 126 const std::string & _varname, 127 std::size_t _record = 1, 128 const std::vector<std::size_t> * _start = NULL, 129 const std::vector<std::size_t> * _count = NULL); 75 130 76 131 protected : // Accesseurs protégés … … 123 178 /*! 124 179 * \brief Retourne l'identifiant de la dimension non limité dans le fichier. 125 * \return l'identifiant de la dimension non limité .180 * \return l'identifiant de la dimension non limité ou <b>-1</b> s'il n'y en a pas. 126 181 */ 127 182 int getUnlimitedDimension(void); … … 134 189 bool varExist(const std::string & _varname); 135 190 136 191 private : // Obtention des informations de lecture 192 193 void getReadDataInfos(const std::string & _varname, 194 std::size_t _record, 195 std::size_t & _array_size, 196 std::vector<std::size_t> & _sstart, 197 std::vector<std::size_t> & _scount, 198 const std::vector<std::size_t> * _start, 199 const std::vector<std::size_t> * _count); 200 201 private : // Lecture 202 203 template <class DataType> 204 void readData_(int _grpid, 205 int _varid, 206 const std::vector<std::size_t> & _sstart, 207 const std::vector<std::size_t> & _scount, 208 DataType * _data); 209 210 template <class DataType> 211 void readAttribute_ 212 (const std::string & _attname, 213 DataType * _value, 214 int _grpid, 215 int _varid = NC_GLOBAL); 216 137 217 private : // Vérification des erreurs NetCDF 138 218 … … 150 230 * \endcode 151 231 */ 152 static void CheckError(int _status) ;232 static void CheckError(int _status) throw (CException); 153 233 154 234 public : // Propriétés privées 155 235 156 CONetCDF4Pathpath; /*!< \brief Chemin vers le groupe de données en cours de lecture. */157 int ncidp; /*!< \brief Identifiant de fichiers netCDF. */236 std::vector<std::string> path; /*!< \brief Chemin vers le groupe de données en cours de lecture. */ 237 int ncidp; /*!< \brief Identifiant de fichiers netCDF. */ 158 238 159 239 }; // class CINetCDF4
Note: See TracChangeset
for help on using the changeset viewer.