Dataset
-
class Dataset : public lue::hdf5::File
This class is for managing LUE datasets.
A dataset represents everything that a LUE file contains. Datasets contain collections of:
universes, which together represent alternative states of a system
phenomena, which together represent one state of a system
Public Functions
-
Dataset(std::string const &name, unsigned int flags, AccessPropertyList const &access_property_list)
-
Dataset(std::string const &name, AccessPropertyList const &access_property_list)
-
explicit Dataset(std::string const &name, unsigned int flags = H5F_ACC_RDONLY)
Open dataset.
It is assumed that the dataset already exists.
- Parameters:
name – Name of dataset
flags – File access flags: H5F_ACC_RDWR, H5F_ACC_RDONLY
- Throws:
std::runtime_error – In case the dataset cannot be opened
-
explicit Dataset(hdf5::File &&file)
-
~Dataset() override = default
-
std::string lue_version() const
-
Universe &add_universe(std::string const &name)
Add new universe to dataset.
See also
Universes::add()
-
Phenomenon &add_phenomenon(std::string const &name, std::string const &description = "")
Add new phenomenon to dataset.
See also
Phenomena::add()
-
std::string const &description() const
-
Universes const &universes() const
Return universes collection.
-
Universes &universes()
Return universes collection.
-
Phenomena const &phenomena() const
Return phenomena collection.
-
Phenomena &phenomena()
Return phenomena collection.
-
bool lue::data_model::dataset_exists(std::string const &name)
Return whether or not a dataset exists.
Warning
This function only checks whether a regular file named name is present. No attempt is made to verify the file is accessible or is formatted correctly.
- Parameters:
name – Name of dataset
-
Dataset lue::data_model::open_dataset(std::string const &name, unsigned int flags, hdf5::File::AccessPropertyList const &access_property_list)
Open dataset.
- Parameters:
name – Name of dataset
- Throws:
std::runtime_error – In case the dataset cannot be created
- Returns:
Dataset instance
-
Dataset lue::data_model::create_dataset(std::string const &name, std::string const &description, hdf5::File::AccessPropertyList access_property_list)
Create dataset.
- Parameters:
name – Name of dataset
- Throws:
std::runtime_error – In case the dataset cannot be created
- Returns:
Dataset instance
-
Dataset lue::data_model::create_in_memory_dataset(std::string const &name, std::string const &description = "")
-
void lue::data_model::remove_dataset(std::string const &name)
Remove dataset.
- Parameters:
name – Name of dataset
- Throws:
std::runtime_error – In case the dataset cannot be removed