IODA Bundle
|
Collection of DataObjects that a Parser collected identified by their exported name. More...
#include <DataContainer.h>
Public Member Functions | |
DataContainer () | |
Simple constructor. More... | |
DataContainer (const CategoryMap &categoryMap) | |
Construct to create container with subcategories. More... | |
void | add (const std::string &fieldName, std::shared_ptr< DataObject > data, const SubCategory &categoryId={}) |
Add a DataObject to the collection. More... | |
std::shared_ptr< DataObject > | get (const std::string &fieldName, const SubCategory &categoryId={}) const |
Get a DataObject from the collection. More... | |
bool | hasKey (const std::string &fieldName, const SubCategory &categoryId={}) const |
Check if DataObject with name is available. More... | |
size_t | size (const SubCategory &categoryId={}) const |
Get the number of rows of the specified sub category. More... | |
std::vector< SubCategory > | allSubCategories () const |
Get the number of rows of the specified sub category. More... | |
CategoryMap | getCategoryMap () const |
Get the map of categories. More... | |
Private Member Functions | |
void | makeDataSets () |
Uses category map to generate listings of all possible subcategories. More... | |
Static Private Member Functions | |
static std::string | makeSubCategoryStr (const SubCategory &categoryId) |
Convenience function used to make a string out of a subcategory listing. More... | |
Private Attributes | |
const CategoryMap | categoryMap_ |
Category map given (see constructor). More... | |
DataSets | dataSets_ |
Map of data for each possible subcategory. More... | |
Collection of DataObjects that a Parser collected identified by their exported name.
Definition at line 37 of file DataContainer.h.
Ingester::DataContainer::DataContainer | ( | ) |
Simple constructor.
Definition at line 21 of file DataContainer.cpp.
|
explicit |
Construct to create container with subcategories.
constructor that creates a underlying data structure to store data in separate sub categories defined by combining all possible combinations of categories defined in the category map.
categoryMap | map of major category types ex: "SatId" to the possible sub types for the category type ex: {"GOES-15", "GOES-16", "GOES-17"}. |
Definition at line 27 of file DataContainer.cpp.
void Ingester::DataContainer::add | ( | const std::string & | fieldName, |
std::shared_ptr< DataObject > | data, | ||
const SubCategory & | categoryId = {} |
||
) |
Add a DataObject to the collection.
fieldName | The unique (export) string that identifies this data |
data | The DataObject to store |
categoryId | The vector<string> for the subcategory |
Definition at line 33 of file DataContainer.cpp.
std::vector< SubCategory > Ingester::DataContainer::allSubCategories | ( | ) | const |
Get the number of rows of the specified sub category.
Definition at line 91 of file DataContainer.cpp.
std::shared_ptr< DataObject > Ingester::DataContainer::get | ( | const std::string & | fieldName, |
const SubCategory & | categoryId = {} |
||
) | const |
Get a DataObject from the collection.
fieldName | The name of the data object ot get |
categoryId | The vector<string> for the subcategory |
Definition at line 48 of file DataContainer.cpp.
|
inline |
Get the map of categories.
Definition at line 79 of file DataContainer.h.
bool Ingester::DataContainer::hasKey | ( | const std::string & | fieldName, |
const SubCategory & | categoryId = {} |
||
) | const |
Check if DataObject with name is available.
fieldName | The name of the object |
categoryId | The vector<string> for the subcategory |
Definition at line 64 of file DataContainer.cpp.
|
private |
Uses category map to generate listings of all possible subcategories.
Definition at line 103 of file DataContainer.cpp.
|
staticprivate |
Convenience function used to make a string out of a subcategory listing.
categoryId | Subcategory (ie: vector<string>) listing. |
Definition at line 154 of file DataContainer.cpp.
size_t Ingester::DataContainer::size | ( | const SubCategory & | categoryId = {} | ) | const |
Get the number of rows of the specified sub category.
categoryId | The vector<string> for the subcategory |
Definition at line 77 of file DataContainer.cpp.
|
private |
Category map given (see constructor).
Definition at line 83 of file DataContainer.h.
|
private |
Map of data for each possible subcategory.
Definition at line 86 of file DataContainer.h.