BioCMAMC-ST
Core::DataExporter Class Reference

A class responsible for exporting various types of data such as matrices, arrays, and metadata in a structured format. More...

#include <data_exporter.hpp>

Inheritance diagram for Core::DataExporter:
[legend]

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
 
DataExporteroperator= (const DataExporter &)=delete
 
DataExporteroperator= (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, MultiMatrixDescriptiondescriptors
 
std::unique_ptr< implpimpl
 

Detailed Description

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.

Member Typedef Documentation

◆ export_initial_kv

Initial value:
std::unordered_map<std::string,
std::variant< size_t, std::string, std::vector< size_t >, double, uint32_t > simple_export_t
Definition data_exporter.hpp:93

Initial export key-value pairs.

◆ export_metadata_kv

Initial value:
std::unordered_map<std::string,
std::variant< uint64_t, int, std::string > export_metadata_t
Metadata types for export.
Definition data_exporter.hpp:86

Key-value pairs for metadata.

◆ export_metadata_t

Initial value:
std::variant<uint64_t, int, std::string>

Metadata types for export.

◆ matrix_variant_t

Initial value:
std::variant<std::span<const double>,
std::span<const std::size_t>,
double>

Variant for matrix data types.

◆ simple_export_t

Initial value:
std::variant<size_t, std::string, std::vector<size_t>, double, uint32_t>

Simple export types

◆ ViewParticleProperties

Initial value:
Kokkos::View<double**, Kokkos::LayoutRight, HostSpace>

View for particle properties.

Constructor & Destructor Documentation

◆ DataExporter() [1/4]

Core::DataExporter::DataExporter ( const DataExporter & )
delete

◆ DataExporter() [2/4]

Core::DataExporter::DataExporter ( DataExporter && )
delete

◆ DataExporter() [3/4]

Core::DataExporter::DataExporter ( )
default

◆ DataExporter() [4/4]

Core::DataExporter::DataExporter ( const ExecInfo & info,
std::string_view _filename,
std::optional< export_metadata_t > user_description = std::nullopt )
explicitprotected

◆ ~DataExporter()

Core::DataExporter::~DataExporter ( )
protecteddefault

Member Function Documentation

◆ append_array()

void Core::DataExporter::append_array ( std::string_view name,
std::span< const double > data,
uint64_t last_size = 0 )
protected
Here is the caller graph for this function:

◆ append_matrix()

void Core::DataExporter::append_matrix ( std::string_view name,
matrix_variant_t data )
protected
Here is the caller graph for this function:

◆ do_link()

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.

Parameters
filenameThe path to the original file to link to.
link_nameThe name of the link that will be created.
groupnameGroup that is linked.

◆ operator=() [1/2]

DataExporter & Core::DataExporter::operator= ( const DataExporter & )
delete

◆ operator=() [2/2]

DataExporter & Core::DataExporter::operator= ( DataExporter && )
delete

◆ prepare_matrix()

void Core::DataExporter::prepare_matrix ( MultiMatrixDescription description)
protected
Here is the caller graph for this function:

◆ write_matrix() [1/2]

void Core::DataExporter::write_matrix ( std::string_view name,
std::span< const double > values,
bool compress = false )
protected
Here is the caller graph for this function:

◆ write_matrix() [2/2]

void Core::DataExporter::write_matrix ( std::string_view name,
std::span< const double > values,
size_t n_row,
size_t n_col,
bool compress = false )
protected

◆ write_properties()

void Core::DataExporter::write_properties ( std::optional< std::string > specific_dataspace,
const export_metadata_kv & values )
protected
Here is the caller graph for this function:

◆ write_simple() [1/2]

void Core::DataExporter::write_simple ( const export_initial_kv & values,
std::string_view root )
protected
Here is the caller graph for this function:

◆ write_simple() [2/2]

void Core::DataExporter::write_simple ( std::string specific_dataspace,
const simple_export_t & values )
protected

Member Data Documentation

◆ descriptors

std::unordered_map<std::string, MultiMatrixDescription> Core::DataExporter::descriptors
private

◆ export_counter

uint64_t Core::DataExporter::export_counter = 0
protected

◆ metadata

export_metadata_kv Core::DataExporter::metadata
protected

◆ pimpl

std::unique_ptr<impl> Core::DataExporter::pimpl
private

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