src/felt_reader/FeltCDMReader.h

Go to the documentation of this file.
00001 /*
00002  * Fimex
00003  * 
00004  * (C) Copyright 2008, met.no
00005  *
00006  * Project Info:  https://wiki.met.no/fimex/start
00007  *
00008  * This library is free software; you can redistribute it and/or modify it
00009  * under the terms of the GNU Lesser General Public License as published by
00010  * the Free Software Foundation; either version 2.1 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00016  * License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
00021  * USA.
00022  */
00023 
00024 #ifndef FELTCDMREADER_H_
00025 #define FELTCDMREADER_H_
00026 
00027 #include <string>
00028 #include <vector>
00029 #include <map>
00030 #include <boost/shared_ptr.hpp>
00031 #include "Felt_File.h"
00032 #include "CDMReader.h"
00033 #include "CDMDimension.h"
00034 #include "ReplaceStringObject.h"
00035 
00036 namespace MetNoFimex
00037 {
00038 class XMLDoc; // declaration without import
00039 
00040 class FeltCDMReader : public CDMReader
00041 {
00042 public:
00043         FeltCDMReader(std::string filename, std::string configFilename) throw(CDMException);
00044         virtual ~FeltCDMReader();
00045         
00046         virtual const boost::shared_ptr<Data> getDataSlice(const std::string& varName, size_t unLimDimPos = 0) throw(CDMException);
00047         virtual const CDM& getCDM() const {return cdm;}
00048         
00049 private:
00050         const std::string filename;
00051         const std::string configFilename;
00052         MetNoFelt::Felt_File feltFile;
00053         CDMDimension xDim;
00054         CDMDimension yDim;
00055         std::map<std::string, std::string> varNameFeltIdMap;
00056         std::vector<std::time_t> timeVec;
00057         std::map<std::string, std::vector<short> > levelVecMap;
00065         std::map<std::string, boost::shared_ptr<ReplaceStringObject> > templateReplacementAttributes;
00066         void init() throw(MetNoFelt::Felt_File_Error, CDMException);
00067         // the following methods are parts of the init function and should not
00068         // be called from elsewhere
00069         std::vector<std::string> initGetKnownFeltIdsFromXML(const XMLDoc& doc);
00070         void initAddGlobalAttributesFromXML(const XMLDoc& doc);
00071         CDMDimension initAddTimeDimensionFromXML(const XMLDoc& doc);
00072         std::map<short, CDMDimension> initAddLevelDimensionsFromXML(const XMLDoc& doc);
00073         void initAddProjectionFromXML(const XMLDoc& doc, std::string& projName, std::string& coordinates);
00074         void initAddVariablesFromXML(const XMLDoc& doc, const std::string& projName, const std::string& coordinates, const CDMDimension& timeDim, const std::map<short, CDMDimension>& levelDims);
00075 
00076 
00077 };
00078 
00079 }
00080 
00081 #endif /*FELTCDMREADER_H_*/

Generated on Thu Jun 5 14:58:22 2008 for MI - Fimex by  doxygen 1.4.6