Template Struct DynamicMultidimSpace¶
Defined in File dynamic_multidim_space.hpp
Inheritance Relationships¶
Base Type¶
public ripple::MultidimSpace< DynamicMultidimSpace< Dimensions > >
(Template Struct MultidimSpace)
Struct Documentation¶
-
template<size_t
Dimensions
>
structripple
::
DynamicMultidimSpace
: public ripple::MultidimSpace<DynamicMultidimSpace<Dimensions>>¶ The DynamicMultidimSpace struct defines spatial information over multiple dimensions, specifically the sizes of the dimensions and the steps required to get from one element to another in the dimensions of the space.
The dynamic nature of the space means that it can be modified. It implements the MultidimSpace interface.
- Template Parameters
Dimensions
: The number of dimensions.
Public Types
-
using
Padding
= uint32_t¶ Defines the size type used for padding.
-
using
Step
= uint32_t¶ Defines the type used to store step information.
Public Functions
-
constexpr
DynamicMultidimSpace
() = default¶ Default constructor enables creation of empty spatial information.
-
template<typename ...
Sizes
, all_arithmetic_size_enable_t<dims, Sizes...> = 0>
constexprDynamicMultidimSpace
(Sizes&&... sizes) noexcept¶ Sets the sizes of the dimensions for the space.
- Parameters
sizes
: The sizes of the dimensions.
- Template Parameters
Sizes
: The type of the sizes.
-
template<typename ...
Sizes
, all_arithmetic_size_enable_t<dims, Sizes...> = 0>
constexprDynamicMultidimSpace
(Padding padding, Sizes&&... sizes) noexcept¶ Sets the sizes of the dimensions for the space and the amount of padding for the space.
- Parameters
padding
: The amount of padding for a side of each dimension.sizes
: The sizes of the dimensions.
- Template Parameters
Sizes
: The type of the sizes.
-
constexpr auto
padding
() noexcept -> Padding&¶ Gets the amount of padding for each side of each dimension for the space.
- Return
A reference to the amount of padding on one side of each dimension.
-
constexpr auto
padding
() const noexcept -> Padding¶ Gets the amount of padding for each side of each dimension for the space.
- Return
The amount of padding on one side of each dimension.
-
constexpr auto
dim_padding
() const noexcept -> Padding¶ Gets the total amounnt of padding for the dimesion, which is twice the dimension per side.
- Return
The total amount of padding for a dimension.
-
constexpr auto
dimensions
() const noexcept -> size_t¶ Gets the number of dimensions for the space.
- Return
The number of dimensions for the space.
-
template<typename ...
Sizes
>
autoresize
(Sizes&&... sizes) noexcept -> void¶ Resizes each of the dimensions specified by the
size
.If
sizeof...(Sizes) < dims
, the firstsizeof...(Sizes)
dimensions are resized. Ifsizeof...(Sizes) > dims
, then a compile time error is generated.- Parameters
sizes
: The sizes to resize the dimensions to.
- Template Parameters
Sizes
: The type of the sizes.
-
template<typename
Dim
>
autoresize_dim
(Dim &&dim, Step size) noexcept -> void¶ Resizes the given dimension to have size number of elements.
- Parameters
dim
: The dimension to resize.size
: The size to resize the dimension to.
- Template Parameters
Dim
: The type of the dimension specifier.
-
template<typename
Dim
>
constexpr autosize
(Dim &&dim) const noexcept -> Step¶ Gets the size of the given dimension.
- Return
The number of elements for the dimension.
- Parameters
dim
: The dimension to get the size of.
- Template Parameters
Dim
: The type of the dimension.
-
constexpr auto
size
() const noexcept -> Step¶ Gets the total size of the N dimensional space i.e the total number of elements in the space.
This is the product sum of the dimension sizes, including the padding for the space.
- Return
The total number of elements in the space, including padding.
-
template<typename
Dim
>
constexpr autointernal_size
(Dim &&dim) const noexcept -> Step¶ Gets the internals size of the given dimension the size without padding elements.
- Return
The number of elements in the given dimension.
- Parameters
dim
: The dimension to get the size of.
- Template Parameters
Dim
: The type of the dimension.
-
constexpr auto
internal_size
() const noexcept -> Step¶ Gets the total internal size of the N dimensional space i.e the total number of elements in the space.
- Note
This is the product sum of the dimension sizes, not including padding.
- Return
The total number of internal elements for the space.
-
template<typename
Dim
>
constexpr autostep
(Dim &&dim) const noexcept -> Step¶ Returns the step size to from one element in the given dimension to the next element in the given dimension.
- Parameters
dim
: The dimension to get the step size in.
- Template Parameters
Dim
: The type of the dimension.
-
template<typename
Dim
>
constexpr autooperator[]
(Dim &&dim) noexcept -> Step&¶ Gets a reference to the size of the given dimension.
- Return
A reference to the size of the space for the given dimension.
- Parameters
dim
: The dimension size to get a refernece to.
- Template Parameters
Dim
: The type of the dimension specifier.
-
template<typename
Dim
>
constexpr autooperator[]
(Dim &&dim) const noexcept -> const Step&¶ Gets a constt reference to the size of the given dimension.
- Return
A const reference to the size of the space for the dimension.
- Parameters
dim
: The dimension size to get a refernece to.
- Template Parameters
Dim
: The type of the dimension specifier.