Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
CSVOptions Struct Reference

Options describing how to interpret or write CSV data. More...

#include <CSVOptions.h>

Public Member Functions

std::type_index & operator[] (const std::string &colName)
 Access or insert the type entry for a given column name.
 

Public Attributes

bool hasIndex = false
 True if the CSV representation contains a separate index column.
 
std::unordered_map< std::string, std::type_index > columnTypes
 Mapping from column name to its declared C++ type.
 
std::type_index indexType = typeid(std::string)
 Type used for the DataFrame index.
 

Detailed Description

Options describing how to interpret or write CSV data.

The CSVOptions structure is used by DataFrame to:

  • remember whether the CSV file contains an explicit index column,
  • store the type of each named column,
  • optionally store the type of the index.

Types are represented using std::type_index and are typically int, double or std::string for this project.

Definition at line 31 of file CSVOptions.h.

Member Function Documentation

◆ operator[]()

std::type_index & CSVOptions::operator[] ( const std::string &  colName)
inline

Access or insert the type entry for a given column name.

If the column is not present in columnTypes, it is inserted with a default placeholder type (typeid(void)) and a reference to that entry is returned.

This is mainly a convenience operator to allow syntax like:

opt["pt"] = typeid(double);
Options describing how to interpret or write CSV data.
Definition CSVOptions.h:31
Parameters
colNameName of the column.
Returns
Reference to the associated std::type_index entry.

Definition at line 68 of file CSVOptions.h.

Member Data Documentation

◆ columnTypes

std::unordered_map<std::string, std::type_index> CSVOptions::columnTypes

Mapping from column name to its declared C++ type.

The type_index values are usually typeid(int), typeid(double), or typeid(std::string). Missing entries may indicate that the column type has not yet been inferred or set.

Definition at line 42 of file CSVOptions.h.

◆ hasIndex

bool CSVOptions::hasIndex = false

True if the CSV representation contains a separate index column.

Definition at line 33 of file CSVOptions.h.

◆ indexType

std::type_index CSVOptions::indexType = typeid(std::string)

Type used for the DataFrame index.

Default is std::string, which matches the usual label-based index.

Definition at line 50 of file CSVOptions.h.


The documentation for this struct was generated from the following file: