Shortcuts

Template Struct DynamicMultidimSpace

Inheritance Relationships

Base Type

Struct Documentation

template<size_t Dimensions>
struct ripple::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>
constexpr DynamicMultidimSpace(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>
constexpr DynamicMultidimSpace(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>
auto resize(Sizes&&... sizes) noexcept -> void

Resizes each of the dimensions specified by the size.

If sizeof...(Sizes) < dims, the first sizeof...(Sizes) dimensions are resized. If sizeof...(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>
auto resize_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 auto size(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 auto internal_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 auto step(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 auto operator[](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 auto operator[](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.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples