BioCMAMC-ST
|
A class responsible for exporting various types of data such as matrices, arrays, and metadata in a structured format. More...
#include <data_exporter.hpp>
Classes | |
class | impl |
struct | MultiMatrixDescription |
Describes the properties of a multi-dimensional matrix for export operations. More... | |
Public Member Functions | |
DataExporter (const DataExporter &)=delete | |
DataExporter (DataExporter &&)=delete | |
DataExporter & | operator= (const DataExporter &)=delete |
DataExporter & | operator= (DataExporter &&)=delete |
DataExporter ()=default | |
void | do_link (std::string_view filename, std::string_view link_name, std::string_view groupname) |
Creates a link to a specified file. | |
Protected Types | |
using | export_metadata_t |
Metadata types for export. | |
using | export_metadata_kv |
Key-value pairs for metadata. | |
using | ViewParticleProperties |
View for particle properties. | |
using | simple_export_t |
using | export_initial_kv |
Initial export key-value pairs. | |
using | matrix_variant_t |
Variant for matrix data types. | |
Protected Member Functions | |
DataExporter (const ExecInfo &info, std::string_view _filename, std::optional< export_metadata_t > user_description=std::nullopt) | |
~DataExporter () | |
void | write_matrix (std::string_view name, std::span< const double > values, bool compress=false) |
void | write_matrix (std::string_view name, std::span< const double > values, size_t n_row, size_t n_col, bool compress=false) |
void | prepare_matrix (MultiMatrixDescription description) |
void | append_matrix (std::string_view name, matrix_variant_t data) |
void | append_array (std::string_view name, std::span< const double > data, uint64_t last_size=0) |
void | write_properties (std::optional< std::string > specific_dataspace, const export_metadata_kv &values) |
void | write_simple (const export_initial_kv &values, std::string_view root) |
void | write_simple (std::string specific_dataspace, const simple_export_t &values) |
Protected Attributes | |
export_metadata_kv | metadata |
uint64_t | export_counter = 0 |
Private Attributes | |
std::unordered_map< std::string, MultiMatrixDescription > | descriptors |
std::unique_ptr< impl > | pimpl |
A class responsible for exporting various types of data such as matrices, arrays, and metadata in a structured format.
The DataExporter
class provides functionality to export numerical data, matrices, arrays, and associated metadata. It supports various data types including numeric, string, and vector-based data, and offers compression and chunking options.
The class uses several utility types such as std::variant
and std::optional
to handle different types of data. It also includes methods for linking data and organizing it into hierarchies within a file system or storage format.
|
protected |
Initial export key-value pairs.
|
protected |
Key-value pairs for metadata.
|
protected |
Metadata types for export.
|
protected |
Variant for matrix data types.
|
protected |
Simple export types
|
protected |
View for particle properties.
|
delete |
|
delete |
|
default |
|
explicitprotected |
|
protecteddefault |
|
protected |
|
protected |
void Core::DataExporter::do_link | ( | std::string_view | filename, |
std::string_view | link_name, | ||
std::string_view | groupname ) |
Creates a link to a specified file.
This function can create either a hard link or a symbolic link to the specified file. The type of link created depends on the implementation details. If the original file does not exist, an error will be thrown.
filename | The path to the original file to link to. |
link_name | The name of the link that will be created. |
groupname | Group that is linked. |
|
delete |
|
delete |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
private |