IODA Bundle
BufrDescription.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2020 NOAA/NWS/NCEP/EMC
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #pragma once
9 
10 #include <map>
11 #include <string>
12 #include <vector>
13 
14 #include "eckit/config/LocalConfiguration.h"
15 
16 #include "BufrTypes.h"
17 #include "Exports/Export.h"
18 
19 
20 namespace Ingester
21 {
22  class BufrMnemonicSet;
23  class Variable;
24 
25  /// \brief Description of the data to be read from a BUFR file and how to expose that data to
26  /// the outside world.
28  {
29  public:
30  BufrDescription() = default;
31  explicit BufrDescription(const eckit::Configuration &conf);
32 
33  /// \brief Add a BufrMnemonicSet to the description.
34  /// \param mnemonicSet BufrMnemonicSet to add
35  void addMnemonicSet(const BufrMnemonicSet& mnemonicSet);
36 
37  // Setters
38  inline void setFilepath(const std::string& filepath) { filepath_ = filepath; }
40  inline void setTablepath(const std::string& tablepath) { tablepath_ = tablepath; }
41  inline void setExport(const Export& newExport) { export_ = newExport; }
42 
43  // Getters
44  inline std::vector<BufrMnemonicSet> getMnemonicSets() const { return mnemonicSets_; }
45  inline std::string filepath() const { return filepath_; }
46  inline bool isWmoFormat() const { return isWmoFormat_; }
47  inline std::string tablepath() const { return tablepath_; }
48  inline Export getExport() const { return export_; }
49 
50  private:
51  /// \brief Sets of mnemonic strings for the data to read.
52  std::vector<BufrMnemonicSet> mnemonicSets_;
53 
54  /// \brief Specifies the relative path to the BUFR file to read.
55  std::string filepath_;
56 
57  /// \brief Does the bufr file use the standard BUFR format (no NCEP table data in file).
59 
60  /// \brief Specifies the relative path to the master tables (applies to std BUFR files).
61  std::string tablepath_;
62 
63  /// \brief Map of export strings to Variable classes.
65  };
66 } // namespace Ingester
Description of the data to be read from a BUFR file and how to expose that data to the outside world.
std::vector< BufrMnemonicSet > getMnemonicSets() const
bool isWmoFormat_
Does the bufr file use the standard BUFR format (no NCEP table data in file).
std::vector< BufrMnemonicSet > mnemonicSets_
Sets of mnemonic strings for the data to read.
void setFilepath(const std::string &filepath)
std::string tablepath() const
void setExport(const Export &newExport)
void setTablepath(const std::string &tablepath)
void setIsWmoFormat(bool isWmoFormat)
void addMnemonicSet(const BufrMnemonicSet &mnemonicSet)
Add a BufrMnemonicSet to the description.
std::string tablepath_
Specifies the relative path to the master tables (applies to std BUFR files).
std::string filepath() const
std::string filepath_
Specifies the relative path to the BUFR file to read.
Export export_
Map of export strings to Variable classes.
Defenition of BUFR mnemonics and associated channels of interest.
Uses configuration to determine all the things needed to be done on export.
Definition: Export.h:25