EleFits
4.0.0
A modern C++ API on top of CFitsIO
|
◆ parseSeq() [1/2]
template<typename T = VariantValue>
Parse a sequence of homogeneous records.
Like for single record reading, there are two ways to parse a sequence of records: with or without fallbacks. For each record to be parsed, if the specified keyword is not found in the header, the fallback is returned. When working with fallbacks, the return type is the same as the type of Example usages without fallbacks: // Homogeneous records
auto vector = h.parseSeq<int>({ "A", "B", "C" });
// Heterogeneous records
auto tuple = h.parseSeq(Named<int>("INT"), Named<float>("FLOAT"));
Example usages with fallbacks: // std::vector to std::vector
auto vector = h.parseSeqOr(fallbacks);
// RecordVec to RecordVec
auto recVec = h.parseSeqOr(fallbacks);
// std::tuple to std::tuple
auto tuple = h.parseSeqOr(fallbacks);
// Variadic to std::tuple
auto tuple = h.parseSeqOr(Record<int>("INT", 0), Record<float>("FLOAT", 3.14));
|