Classes to store header unit data.
A header is made of records, represented in memory by objects of type... Record! A Record is a simple structure which stores the keyword, value, unit and comment, and is templated by the value type.
Passing a large number of records around can be complex, all the more if the value types are different given how cumbersome it would be to use a std::tuple of various Records.
Two record containers are provided to ease this:
RecordVec is a homogeneous container, i.e. the value type is the same for each contained record;RecordSeq is an alias for RecordVec<VariantValue>, which represents a run-time tuple.Records in those containers are convertible thanks to an internal casting system.
TypedKey is a tool used to robustify the API, for more safety when reading a record (or a column). It conveys alone both the name and type of the record. TypedKeys are preferrably created with function as().
TypedKeys are used to write the type close to the name of the records in function calls, that is, writing:
instead of:
which would be error-prone when reading many records.
Typedefs | |
| using | VariantValue = boost::any |
| The variant value type for records. More... | |
| using | RecordSeq = RecordVec< VariantValue > |
| A sequence of records of any type. | |
Classes | |
| struct | Record< T > |
| Keyword-value pair with optional unit and comment. More... | |
| class | RecordVec< T > |
| A vector of records with find and conversion services. More... | |
Macros | |
| #define | ELEFITS_FOREACH_RECORD_TYPE(MACRO) |
| Loop over supported record types. More... | |