![]() |
EleFits
4.0.0
A modern C++ API on top of CFitsIO
|
#include <Column.h>
Column metadata, i.e. { name, unit, repeatCount } and the value type as the template parameter.
Binary table columns are either scalar (repeatCount = 1) or vector (repeatCount > 1). In the case of vector columns, each cell of the column contains repeatCount values. Here is an example of a 4-row table with a scalar column and a vector column with a repeat count of 3:
| Row | repeatCount = 1 | repeatCount = 3 |
|---|---|---|
| 0 | 00 | 00, 01, 02 |
| 1 | 10 | 10, 11, 12 |
| 2 | 20 | 20, 21, 22 |
| 3 | 30 | 30, 31, 32 |
For performance, the values are stored sequentially in a 1D array as follows:
The only exception to this is string columns, which are vector columns – they should have a repeat count greater than the maximum number of characters in a cell – but each cell contains only one string:
| Row | repeatCount = 6 |
|---|---|
| 0 | "ZERO" |
| 1 | "ONE" |
| 2 | "TWO" |
| 3 | "THREE" |
The data array is a simple array of std::strings:
but the repeat count should be at least 6 (beware of the null terminating character).
Public Types | |
| using | Value = T |
| The value type. | |
Public Attributes | |
| std::string | name |
| Column name. | |
| std::string | unit = "" |
| Column unit. | |
| long | repeatCount = 1 |
| Repeat count of the column, i.e., number of values per cell. More... | |