MI - Fimex
NetCDF_CDMReader.h
Go to the documentation of this file.
1 /*
2  * Fimex
3  *
4  * (C) Copyright 2008, met.no
5  *
6  * Project Info: https://wiki.met.no/fimex/start
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21  * USA.
22  */
23 
24 #ifndef NETCDF_CDMREADER_H_
25 #define NETCDF_CDMREADER_H_
26 
27 #ifndef MIFI_IO_READER_SUPPRESS_DEPRECATED
28 #warning \
29  This header-file is deprecated and \
30  may be removed without further notice at a future date. Please use a \
31  non-deprecated interface with equivalent functionality instead, i.e. \
32  instead of \
33  *CDMReader(file,config) \
34  use \
35  CDMFileReaderFactory::create(MIFI_FILETYPE_*,file,config)
36 #endif
37 
38 #include "fimex/CDMReaderWriter.h"
39 
40 namespace MetNoFimex
41 {
42 // forward decl
43 class Nc;
44 
51 {
52  const std::auto_ptr<Nc> ncFile;
53 public:
54  NetCDF_CDMReader(const std::string& fileName, bool writable = false);
55  virtual ~NetCDF_CDMReader();
56  virtual DataPtr getDataSlice(const std::string& varName, size_t unLimDimPos);
57  virtual DataPtr getDataSlice(const std::string& varName, const SliceBuilder& sb);
58  virtual void sync();
59  virtual void putDataSlice(const std::string& varName, size_t unLimDimPos, const DataPtr data);
60  virtual void putDataSlice(const std::string& varName, const SliceBuilder& sb, const DataPtr data);
61 private:
62  void addAttribute(const std::string& varName, int varid, const std::string& attName);
63 };
64 
65 }
66 
67 #endif /*NETCDF_CDMREADER_H_*/
basic_string< char > string
virtual void sync()
flush data to disc
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos)
data-reading function to be called from the CDMWriter
boost::shared_ptr< Data > DataPtr
Definition: DataDecl.h:39
Definition: SliceBuilder.h:46
Definition: CDMReaderWriter.h:41
Definition: C_CDMReader.h:35
virtual void putDataSlice(const std::string &varName, size_t unLimDimPos, const DataPtr data)
data-writing function
Definition: NetCDF_CDMReader.h:50
NetCDF_CDMReader(const std::string &fileName, bool writable=false)