MI - Fimex
NcmlCDMReader.h
Go to the documentation of this file.
1 /*
2  * Fimex, NcmlCDMReader.h
3  *
4  * (C) Copyright 2009, 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  * Created on: Apr 29, 2009
24  * Author: Heiko Klein
25  */
26 
27 #ifndef NCMLCDMREADER_H_
28 #define NCMLCDMREADER_H_
29 
30 #include "fimex/CDMReader.h"
31 #include "fimex/CDMDataType.h"
32 #include "fimex/XMLInput.h"
33 #include <map>
34 #include <memory>
35 
36 namespace MetNoFimex
37 {
38 /* forward declarations */
39 class XMLDoc;
40 class MutexType;
41 
98 {
99 
100 public:
105  NcmlCDMReader(const XMLInput& configXML);
111  NcmlCDMReader(const boost::shared_ptr<CDMReader> dataReader, const XMLInput& configXML);
112  virtual ~NcmlCDMReader();
116  virtual DataPtr getDataSlice(const std::string& varName, size_t unLimDimPos = 0);
120  virtual DataPtr getDataSlice(const std::string& varName, const SliceBuilder& sb);
121 
122 
123 private:
127  void init();
128  void setConfigDoc(const XMLInput& configXML);
129  /* log a info of msg if xpath in config file */
130  void initRemove();
131  void warnUnsupported(std::string xpath, std::string msg);
132  void initWarnUnsupported();
133  void initVariableShapeChange();
134  void initVariableNameChange();
135  void initVariableTypeChange();
136  void initVariableDataChange();
137  void initVariableSpatialVector();
138  void initDimensionNameChange();
139  void initDimensionUnlimited();
140  void initAttributeNameChange();
141  void initAddReassignAttribute();
142 
143  std::string configId;
144  boost::shared_ptr<XMLDoc> doc;
146  boost::shared_ptr<CDMReader> dataReader;
147  /*
148  * maps containing the changes. The key will reflect
149  * this CDM, while the value references to dataReader->cdm
150  */
151  std::map<std::string, std::string> variableNameChanges;
152  std::map<std::string, CDMDataType> variableTypeChanges;
153  std::map<std::string, std::string> dimensionNameChanges;
154  // maps dimension-name to original dimension-name of the
155  // dimensions which changed to or from unlimited dimension
156  std::map<std::string, std::string> unlimitedDimensionChanges;
157 
158 
159 };
160 
161 }
162 
163 #endif /* NCMLCDMREADER_H_ */
basic_string< char > string
virtual DataPtr getDataSlice(const std::string &varName, size_t unLimDimPos=0)
boost::shared_ptr< Data > DataPtr
Definition: DataDecl.h:39
NcmlCDMReader(const XMLInput &configXML)
Definition: SliceBuilder.h:46
Definition: C_CDMReader.h:35
Basic interface for CDM reading and manipulation classes.
Definition: CDMReader.h:53
Definition: NcmlCDMReader.h:97
Definition: XMLInput.h:49