Shortcuts

Template Struct ContigStorageHelper

Nested Relationships

Struct Documentation

template<typename ...Ts>
struct ripple::detail::ContigStorageHelper

Helper class for contiguous storage of multiple type.

Template Parameters
  • Ts: the types to store contiguously.

Public Static Functions

constexpr auto storage_byte_size() noexcept -> size_t

Determines the effective byte size of all elements to store, including any required padding.

This should not be called, other than to define byte_size_v, since it is expensive to compile.

Return

The number of bytes required for the storage.

template<size_t I>
constexpr auto offset_to()

Determines the offset, in bytes, to the index I in the type list, accounting for any required padding due to badly specified data layout.

Return

The offset, in bytes, to the Ith element.

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

constexpr auto offsets() -> Vec<num_types>

Gets an array of offsets for each of the types.

Return

An array for which each element in the offset in bytes to the Ith type.

template<size_t... Is>
constexpr auto make_offsets(std::index_sequence<Is...>)

Implementation of offset helper to make the offsets.

Return

An array for which each element is the offfset in bytes to the Ith type.

Template Parameters
  • Is: The indices to use to make the offsets.

Public Static Attributes

constexpr size_t num_types = sizeof...(Ts)

Defines the number of different types.

template<typename T>
constexpr size_t element_components_v = storage_element_traits_t<T>::num_elements

Gets the number of components for the storage element.

Template Parameters
  • T: The type to get the size of.

constexpr size_t byte_sizes[num_types] = {storage_element_traits_t<Ts>::byte_size...}

Defines the sizes of each of the types.

constexpr size_t align_sizes[num_types] = {storage_element_traits_t<Ts>::align_size...}

Defines the alignment sizes of each of the types.

constexpr size_t components[num_types] = {element_components_v<Ts>...}

Defines the number of components in each of the types.

constexpr size_t max_align = max_element(storage_element_traits_t<Ts>::align_size...)

Defines the max alignment of the types.

template<size_t N>
struct Vec

Small vector type for constexpr constexts which can be used on both the host and the device to get the offset to the types at compile time.

Template Parameters
  • N: The number of elements for the vector.

Public Functions

template<typename ...As>
constexpr Vec(As&&... as) noexcept

Constructor to set the values of the vector elements.

Parameters
  • as: The values for the vector.

Template Parameters
  • As: The type of the elements.

constexpr auto operator[](size_t i) const -> size_t

Overload of subscript operator to get the ith value.

Return

The value of the ith element.

Parameters
  • i: The index of the element to get.

Public Members

size_t data[N] = {}

Data for the vector.

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