19 #include <type_traits>
21 #include <boost/algorithm/string.hpp>
24 namespace GridContainer {
31 template<
size_t I,
typename GridCellManager,
typename ...Axes>
44 auto& axis = grid.template getAxis<I - 1>();
46 auto name = axis.name();
47 boost::replace_all(name,
" ",
"_");
66 template<
typename ...Args>
70 auto& axis = grid.template getAxis<I - 1>();
71 for (
size_t i = 0; i < axis.size(); ++i) {
83 auto& axis = grid.template getAxis<I - 1>();
84 for (
size_t i = 0; i < axis.size(); ++i) {
93 template<
typename GridCellManager,
typename ...Axes>
104 template<
typename ...Args>
114 cell_traits.
addCells(grid.at(axes.first...), row_content);
124 template<
typename GridCellManager,
typename ...AxesTypes>
126 using GridType =
GridContainer<GridCellManager, AxesTypes...>;
135 auto column_info = std::make_shared<Table::ColumnInfo>(
std::move(columns));
140 Helper::unfold(grid, column_info, rows);
iterator begin()
Returns an iterator to the first cell of the grid.
size_t size() const
Returns the total number of cells of the grid.
const std::tuple< GridAxis< AxesTypes >...> & getAxesTuple() const
Returns a tuple containing the information of all the grid axes.
static void addColumnDescriptions(const GridContainer< GridCellManager, Axes...> &grid, std::vector< Table::ColumnDescription > &description)
Representation of a multi-dimensional grid which contains axis information.
static void addColumnDescriptions(const GridContainer< GridCellManager, Axes...> &, std::vector< Table::ColumnDescription > &)
static void unfold(const GridContainer< GridCellManager, Axes...> &grid, const std::shared_ptr< Table::ColumnInfo > &column_info, std::vector< Table::Row > &rows, std::pair< size_t, Args >...axes)
static void unfold(const GridContainer< GridCellManager, Axes...> &grid, const std::shared_ptr< Table::ColumnInfo > &column_info, std::vector< Table::Row > &rows, std::pair< size_t, Args >...axes)
static void addColumnDescriptions(const T &c, std::vector< Table::ColumnDescription > &columns)
static void addCells(const T &c, std::vector< Table::Row::cell_type > &row)
static void unfold(const GridContainer< GridCellManager, Axes...> &grid, const std::shared_ptr< Table::ColumnInfo > &column_info, std::vector< Table::Row > &rows)
Table::Table gridContainerToTable(const GridContainer< GridCellManager, AxesTypes...> &grid)