IODA Bundle
BufrCollectors.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 <memory>
12 #include <string>
13 #include <vector>
14 
15 #include "BufrParser/BufrTypes.h"
16 
17 
18 namespace Ingester
19 {
20  class BufrMnemonicSet;
21  class BufrAccumulator;
22  class BufrCollector;
23 
24  /// \brief Manager of collectors.
26  {
27  public:
28  explicit BufrCollectors(unsigned int fortranFileId);
29  ~BufrCollectors() = default;
30 
31  /// \brief Add collectors for mnemonic sets
32  /// \param mnemonicSets list of BufrMnemonicSet to use
33  void addMnemonicSets(const std::vector<BufrMnemonicSet>& mnemonicSets);
34 
35  /// \brief Add collector for a mnemonic set
36  /// \param mnemonicSet BufrMnemonicSet to use
37  void addMnemonicSet(const BufrMnemonicSet& mnemonicSet);
38 
39  /// \brief Cause all the collectors to grab the next peaces of data from the BUFR file.
40  void collect();
41 
42  /// \brief Finalize all the collectors and assemble the resulting data into a map.
44 
45  private:
46  /// \brief Fortran file ID for the open BUFR file
47  unsigned int fortranFileId_;
48 
49  /// \brief Collection of all the collectors being managed.
50  std::vector<std::shared_ptr<BufrCollector>> collectors_;
51  };
52 } // namespace Ingester
Manager of collectors.
BufrDataMap finalize()
Finalize all the collectors and assemble the resulting data into a map.
std::vector< std::shared_ptr< BufrCollector > > collectors_
Collection of all the collectors being managed.
BufrCollectors(unsigned int fortranFileId)
void collect()
Cause all the collectors to grab the next peaces of data from the BUFR file.
unsigned int fortranFileId_
Fortran file ID for the open BUFR file.
void addMnemonicSets(const std::vector< BufrMnemonicSet > &mnemonicSets)
Add collectors for mnemonic sets.
void addMnemonicSet(const BufrMnemonicSet &mnemonicSet)
Add collector for a mnemonic set.
Defenition of BUFR mnemonics and associated channels of interest.
IngesterArrayMap BufrDataMap
Definition: BufrTypes.h:21