IODA Bundle
Ingester::BufrParser Class Referencefinal

Uses a BufrDescription and helper classes to parse the contents of a BUFR file. More...

#include <BufrParser.h>

Inheritance diagram for Ingester::BufrParser:
[legend]
Collaboration diagram for Ingester::BufrParser:
[legend]

Public Member Functions

 BufrParser (const BufrDescription &description)
 
 BufrParser (const eckit::Configuration &conf)
 
 ~BufrParser ()
 
std::shared_ptr< DataContainerparse (const size_t maxMsgsToParse=0) final
 Uses the provided description to parse the buffer file. More...
 
void reset () final
 Start over from beginning of the BUFR file. More...
 
- Public Member Functions inherited from Ingester::Parser
 Parser ()=default
 
 Parser (const eckit::Configuration &conf)
 
virtual ~Parser ()=default
 

Private Types

typedef std::map< std::vector< std::string >, BufrDataMapCatDataMap
 

Private Member Functions

std::shared_ptr< DataContainerexportData (const BufrDataMap &srcData)
 Exports collected data into a DataContainer. More...
 
CatDataMap splitData (CatDataMap &splitMaps, Split &split)
 Function responsible for dividing the data into subcategories. More...
 
void openBufrFile (const std::string &filepath, bool isWmoFormat, const std::string &tablepath)
 Opens a BUFR file using the Fortran BUFR interface. More...
 
void closeBufrFile ()
 Closes the open BUFR file. More...
 
void printMap (const CatDataMap &map)
 Convenience method to print the Categorical data map to stdout. More...
 

Private Attributes

BufrDescription description_
 The description the defines what to parse from the BUFR file. More...
 
unsigned int fortranFileId_
 The Fortran file ID to an open BUFR file (0 when no file open) More...
 
unsigned int table1FileId_
 The Fortran file ID to an open BUFR file (0 when no file open) More...
 
unsigned int table2FileId_
 The Fortran file ID to an open BUFR file (0 when no file open) More...
 

Detailed Description

Uses a BufrDescription and helper classes to parse the contents of a BUFR file.

Definition at line 30 of file BufrParser.h.

Member Typedef Documentation

◆ CatDataMap

typedef std::map<std::vector<std::string>, BufrDataMap> Ingester::BufrParser::CatDataMap
private

Definition at line 46 of file BufrParser.h.

Constructor & Destructor Documentation

◆ BufrParser() [1/2]

Ingester::BufrParser::BufrParser ( const BufrDescription description)
explicit

Definition at line 31 of file BufrParser.cpp.

Here is the call graph for this function:

◆ BufrParser() [2/2]

Ingester::BufrParser::BufrParser ( const eckit::Configuration &  conf)
explicit

Definition at line 40 of file BufrParser.cpp.

Here is the call graph for this function:

◆ ~BufrParser()

Ingester::BufrParser::~BufrParser ( )

Definition at line 49 of file BufrParser.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ closeBufrFile()

void Ingester::BufrParser::closeBufrFile ( )
private

Closes the open BUFR file.

Definition at line 175 of file BufrParser.cpp.

Here is the caller graph for this function:

◆ exportData()

std::shared_ptr< DataContainer > Ingester::BufrParser::exportData ( const BufrDataMap srcData)
private

Exports collected data into a DataContainer.

Parameters
srcDataData to export

Definition at line 83 of file BufrParser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openBufrFile()

void Ingester::BufrParser::openBufrFile ( const std::string &  filepath,
bool  isWmoFormat,
const std::string &  tablepath 
)
private

Opens a BUFR file using the Fortran BUFR interface.

Parameters
filepathPath to bufr file.
isWmoFormatoptional Bufr file is in the standard format.
tablepathoptional Path to WMO master tables (needed for standard bufr files).

Definition at line 151 of file BufrParser.cpp.

Here is the caller graph for this function:

◆ parse()

std::shared_ptr< DataContainer > Ingester::BufrParser::parse ( const size_t  maxMsgsToParse = 0)
finalvirtual

Uses the provided description to parse the buffer file.

Parameters
maxMsgsToParseMessages to parse (0 for everything)

Implements Ingester::Parser.

Definition at line 54 of file BufrParser.cpp.

Here is the call graph for this function:

◆ printMap()

void Ingester::BufrParser::printMap ( const CatDataMap map)
private

Convenience method to print the Categorical data map to stdout.

Definition at line 196 of file BufrParser.cpp.

◆ reset()

void Ingester::BufrParser::reset ( )
finalvirtual

Start over from beginning of the BUFR file.

Implements Ingester::Parser.

Definition at line 184 of file BufrParser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitData()

BufrParser::CatDataMap Ingester::BufrParser::splitData ( BufrParser::CatDataMap splitMaps,
Split split 
)
private

Function responsible for dividing the data into subcategories.

This function is intended to be called over and over for each specified Split object, sub-splitting the data given into all the possible subcategories.

Parameters
splitMapsPre-split map of data.
splitObject that knows how to split data.

Definition at line 132 of file BufrParser.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ description_

BufrDescription Ingester::BufrParser::description_
private

The description the defines what to parse from the BUFR file.

Definition at line 49 of file BufrParser.h.

◆ fortranFileId_

unsigned int Ingester::BufrParser::fortranFileId_
private

The Fortran file ID to an open BUFR file (0 when no file open)

Definition at line 52 of file BufrParser.h.

◆ table1FileId_

unsigned int Ingester::BufrParser::table1FileId_
private

The Fortran file ID to an open BUFR file (0 when no file open)

Definition at line 55 of file BufrParser.h.

◆ table2FileId_

unsigned int Ingester::BufrParser::table2FileId_
private

The Fortran file ID to an open BUFR file (0 when no file open)

Definition at line 58 of file BufrParser.h.


The documentation for this class was generated from the following files: