7#include "grid_layout.hpp"
10namespace hi {
inline namespace v1 {
12template<axis Axis,
typename T>
15 static_assert(Axis == axis::x or Axis == axis::y);
19 using cell_type = grid_type::cell_type;
20 using iterator = grid_type::iterator;
21 using const_iterator = grid_type::const_iterator;
31 [[nodiscard]]
constexpr bool empty()
const noexcept
36 [[nodiscard]]
constexpr size_t size()
const noexcept
41 [[nodiscard]]
constexpr iterator begin()
noexcept
46 [[nodiscard]]
constexpr const_iterator begin()
const noexcept
51 [[nodiscard]]
constexpr const_iterator cbegin()
const noexcept
53 return _grid.cbegin();
56 [[nodiscard]]
constexpr iterator end()
noexcept
61 [[nodiscard]]
constexpr const_iterator end()
const noexcept
66 [[nodiscard]]
constexpr const_iterator cend()
const noexcept
71 [[nodiscard]]
constexpr cell_type& operator[](
size_t index)
noexcept
77 [[nodiscard]]
constexpr cell_type
const& operator[](
size_t index)
const noexcept
83 cell_type& insert(const_iterator pos, std::convertible_to<T>
auto&& value)
noexcept
87 for (
auto it = begin() + index; it != end(); ++it) {
88 if constexpr (Axis == axis::x) {
97 if constexpr (Axis == axis::x) {
104 cell_type& push_front(std::convertible_to<T>
auto&& value)
noexcept
109 cell_type& push_back(std::convertible_to<T>
auto&& value)
noexcept
114 void clear()
noexcept
116 return _grid.clear();
119 [[nodiscard]]
box_constraints constraints(
bool left_to_right)
const noexcept
121 return _grid.constraints(left_to_right);
124 void set_layout(
box_shape const &shape,
int guideline)
noexcept
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
2D constraints.
Definition box_constraints.hpp:25
Definition box_shape.hpp:15
Grid layout algorithm.
Definition grid_layout.hpp:932
constexpr reference add_cell(size_t first_column, size_t first_row, size_t last_column, size_t last_row, Value &&value, bool beyond_maximum=false) noexcept
Check if the cell on the grid is already in use.
Definition grid_layout.hpp:1054
constexpr void set_layout(box_shape const &shape, int baseline_adjustment) noexcept
Layout the cells based on the width and height.
Definition grid_layout.hpp:1130
Definition row_column_layout.hpp:13