Shortcuts

Template Struct DefaultStorage

Nested Relationships

Struct Documentation

template<typename T>
struct ripple::DefaultStorage

Default storage to store a type T.

Template Parameters
  • T: The type for allocation.

Public Types

using Storage = T*

The type of the storage.

Public Static Attributes

template<size_t I>
constexpr size_t nth_element_components_v = 1

Defines the number of components for the Nth element, which in this case is always 1.

Template Parameters
  • I: The index of the element to get the number of components for.

struct Allocator

Allocator for default storage.

This can be used to determine the memory requirement for the storage for different spatial configurations, as well as to offset DefaultStorage elements within the allocated space.

Public Static Functions

constexpr auto strided_types() noexcept -> size_t

Gets the number of types which are stored strided.

Return

The number of types which are stored strided.

template<size_t I>
constexpr auto num_elements() noexcept -> size_t

Gets the number of elements in the Ith type.

Return

The number of elements in the ith type.

Template Parameters
  • I: The index of the type.

template<size_t I>
constexpr auto element_byte_size() noexcept -> size_t

Gets the number of bytes for an elemeent in the Ith type.

Return

The number of bytes for an element in the Ith type.

Template Parameters
  • I: The index of the type to get the element size of.

constexpr auto allocation_size(size_t elements) noexcept -> size_t

Gets the number of bytes required to allocate a total of elements of the types defined by Ts.

Return

The number of bytes required to allocate the given number of elements.

Parameters
  • elements: The number of elements to allocate.

template<size_t Elements>
constexpr auto allocation_size() noexcept -> size_t

Gets the number of bytes required to allocate a total of Elements of the types defined by Ts.

This overload of the function can be used to allocate static memory when the number of elements in the space is known at compile time.

Return

The number of bytes required to allocate the given number of elements.

Template Parameters
  • Elements: The number of elements to allocate.

template<typename SpaceImpl, typename Dim, diff_enable_t<Dim, int> = 0>
auto offset(const Storage &storage, const MultidimSpace<SpaceImpl> &space, Dim &&dim, int amount) -> Storage

Offsets the storage by the amount specified by amount in the dimension dim.

Return

A new DefaultStorage offset by the given amount.

Parameters
  • storage: The storage to offset.

  • space: The space for which the storage is defined.

  • dim: The dimension to offset in.

Template Parameters
  • SpaceImpl: The implementation of the spatial interface.

  • Dim: The type of the dimension.

template<typename SpaceImpl, typename Dim>
auto shift(Storage &storage, const MultidimSpace<SpaceImpl> &space, Dim &&dim, int amount) -> void

Shifts the storage by the amount specified by amount in the dimension dim.

Parameters
  • storage: The storage to offset.

  • space: The space for which the storage is defined.

  • dim: The dimension to offset in.

Template Parameters
  • SpaceImpl: The implementation of the spatial interface.

  • Dim: The type of the dimension.

template<typename SpaceImpl>
auto create(void *ptr, const MultidimSpace<SpaceImpl> &space) -> Storage

Creates the storage, initializing a T instance which points to ptr.

Return

A new DefaultStorage type pointing to the given pointer.

Parameters
  • ptr: A pointer to the beginning of the memory space.

  • space: The multidimensional space which defines the domain.

Template Parameters
  • SpaceImpl: The implementation of the spatial interface.

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