IODA Bundle
|
Data splitter class that splits data according to a predefined categories. More...
#include <CategorySplit.h>
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, BufrDataMap > | split (const BufrDataMap &dataMap) final |
Split the data according to internal rules. More... | |
std::string | getMnemonic () |
![]() | |
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_ |
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.
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.
Ingester::CategorySplit::CategorySplit | ( | const std::string & | mnemonic, |
const NameMap & | map | ||
) |
constructor
mnemonic | BUFR mnemonic to base the split on. |
map | Name 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.
|
inline |
Definition at line 59 of file CategorySplit.h.
|
finalvirtual |
Split the data according to internal rules.
dataMap | Data to be split |
Implements Ingester::Split.
Definition at line 38 of file CategorySplit.cpp.
|
finalvirtual |
Get list of sub categories this split will create.
Implements Ingester::Split.
Definition at line 25 of file CategorySplit.cpp.
|
private |
Adds values to nameMap_ using the data if nameMap_ is empty.
dataMap | Data to be split |
Definition at line 74 of file CategorySplit.cpp.
|
private |
Definition at line 63 of file CategorySplit.h.
|
private |
Definition at line 62 of file CategorySplit.h.