Structure to hold the entire OPAT file.
More...
#include <opatIO.h>
|
std::ostream & | operator<< (std::ostream &os, const OPAT &opat) |
| Stream insertion operator for printing the OPAT structure.
|
|
Structure to hold the entire OPAT file.
The OPAT structure contains the file header, card catalog, and all DataCards.
- Examples
- /Users/tboudreaux/Programming/opat-core/opatIO-cpp/src/private/fextern.cpp.
◆ get() [1/2]
Retrieves a DataCard from the OPAT structure by index.
- Parameters
-
index | The index vector of the DataCard to retrieve. |
- Returns
- A constant reference to the DataCard.
- Exceptions
-
std::out_of_range | if the index is not found. |
◆ get() [2/2]
const DataCard & opat::OPAT::get |
( |
const std::vector< double > & | index | ) |
const |
|
inlinenodiscard |
Retrieves a DataCard from the OPAT structure by a standard vector of doubles. This is a convenience overload that constructs a FloatIndexVector internally.
- Parameters
-
index | The std::vector<double> representing the index of the DataCard to retrieve. |
- Returns
- A constant reference to the DataCard.
- Exceptions
-
std::out_of_range | if the index is not found. |
Example:
std::vector<double> my_index = {1.0, 2.5};
Structure to hold a DataCard, which contains multiple tables.
Definition opatIO.h:409
const OPATTable & get(const std::string &tag) const
Retrieves a table from the DataCard by tag.
Definition opatIO.cpp:284
◆ getBounds()
std::vector< Bounds > opat::OPAT::getBounds |
( |
| ) |
const |
|
nodiscard |
Calculates and returns the bounds (min and max values) for each dimension of the index vectors in the OPAT file.
- Returns
- A vector of Bounds structs, where each struct corresponds to a dimension of the index vectors. The size of the returned vector will be equal to
header.numIndex
.
Example:
std::vector<opat::Bounds> all_bounds = opat_file.getBounds();
for (size_t i = 0; i < all_bounds.size(); ++i) {
std::cout << "Dimension " << i << ": Min = " << all_bounds[i].min
<< ", Max = " << all_bounds[i].max << std::endl;
}
◆ operator[]() [1/2]
Accesses a DataCard from the OPAT structure by index.
- Parameters
-
index | The index vector of the DataCard to access. |
- Returns
- A constant reference to the DataCard.
- Exceptions
-
std::out_of_range | if the index is not found. |
◆ operator[]() [2/2]
const DataCard & opat::OPAT::operator[] |
( |
const std::vector< double > & | index | ) |
const |
|
inline |
Accesses a DataCard from the OPAT structure by a standard vector of doubles. This is a convenience overload that constructs a FloatIndexVector internally.
- Parameters
-
index | The std::vector<double> representing the index of the DataCard to access. |
- Returns
- A constant reference to the DataCard.
- Exceptions
-
std::out_of_range | if the index is not found. |
Example:
std::vector<double> my_index = {1.0, 2.5};
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const OPAT & | opat ) |
|
friend |
Stream insertion operator for printing the OPAT structure.
- Parameters
-
os | Output stream. |
opat | OPAT structure to print. |
- Returns
- Reference to the output stream.
◆ cardCatalog
Catalog of DataCards in the file.
◆ cards
Map of index vectors to DataCards.
◆ header
The documentation for this struct was generated from the following files: