IODA Bundle
Ingester::CategorySplit Class Reference

Data splitter class that splits data according to a predefined categories. More...

#include <CategorySplit.h>

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

Public Types

typedef std::map< int, std::string > NameMap
 Map of integers to strings where the key represents the split mnemonics integer value and the value is a human readable name for the key. More...
 

Public Member Functions

 CategorySplit (const std::string &mnemonic, const NameMap &map)
 constructor More...
 
std::vector< std::string > subCategories (const BufrDataMap &dataMap) final
 Get list of sub categories this split will create. More...
 
std::map< std::string, BufrDataMapsplit (const BufrDataMap &dataMap) final
 Split the data according to internal rules. More...
 
std::string getMnemonic ()
 
- Public Member Functions inherited from Ingester::Split
 Split ()=default
 

Private Member Functions

void updateNameMap (const BufrDataMap &dataMap)
 Adds values to nameMap_ using the data if nameMap_ is empty. More...
 

Private Attributes

NameMap nameMap_
 
const std::string mnemonic_
 

Detailed Description

Data splitter class that splits data according to a predefined categories.

This class sub-divides data into sub-categories depending on the value of a mnemonic. It is assumed that the mnemonic values are integers which represent separate categories of data. An example is Satellite ID (mnemonic: SAID) where each possible satellite has its own unique integer ID. The subcategories this Split divides into can either be manually specified by a NameMap (map<integer, string>) or be automatically determined (if the given NameMap is found to be empty). An example NameMap might look like this: { 257 : GEOS-13, 259 : GEOS-15 } This NameMap tells the splitter to divide by the values of the given mnemonic (SAID for this example) into two named groups (GEOS-13 and GEOS-15). Data associated with mnemonic values not specified in the map are discarded. If the NameMap were empty (unspecified) then this splitter will use the data to to determine all all the possible values to split on automatically. Each split would then be named according to its integer value (ex: 257, 259, 270, 271, ....).

Definition at line 35 of file CategorySplit.h.

Member Typedef Documentation

◆ NameMap

typedef std::map<int, std::string> Ingester::CategorySplit::NameMap

Map of integers to strings where the key represents the split mnemonics integer value and the value is a human readable name for the key.

Definition at line 40 of file CategorySplit.h.

Constructor & Destructor Documentation

◆ CategorySplit()

Ingester::CategorySplit::CategorySplit ( const std::string &  mnemonic,
const NameMap map 
)

constructor

Parameters
mnemonicBUFR mnemonic to base the split on.
mapName of the created categories from the integer BUFR values. May be an empty map in which case subcategories are automatically determined from the data.

Definition at line 19 of file CategorySplit.cpp.

Member Function Documentation

◆ getMnemonic()

std::string Ingester::CategorySplit::getMnemonic ( )
inline

Definition at line 59 of file CategorySplit.h.

◆ split()

std::map< std::string, BufrDataMap > Ingester::CategorySplit::split ( const BufrDataMap dataMap)
finalvirtual

Split the data according to internal rules.

Parameters
dataMapData to be split
Returns
map of split data where the category is the key

Implements Ingester::Split.

Definition at line 38 of file CategorySplit.cpp.

Here is the call graph for this function:

◆ subCategories()

std::vector< std::string > Ingester::CategorySplit::subCategories ( const BufrDataMap dataMap)
finalvirtual

Get list of sub categories this split will create.

Returns
Set of unique strings.

Implements Ingester::Split.

Definition at line 25 of file CategorySplit.cpp.

Here is the call graph for this function:

◆ updateNameMap()

void Ingester::CategorySplit::updateNameMap ( const BufrDataMap dataMap)
private

Adds values to nameMap_ using the data if nameMap_ is empty.

Parameters
dataMapData to be split

Definition at line 74 of file CategorySplit.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ mnemonic_

const std::string Ingester::CategorySplit::mnemonic_
private

Definition at line 63 of file CategorySplit.h.

◆ nameMap_

NameMap Ingester::CategorySplit::nameMap_
private

Definition at line 62 of file CategorySplit.h.


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