Template Struct ContigStorageHelper¶
Defined in File storage_element_traits.hpp
Struct Documentation¶
-
template<typename ...
Ts
>
structripple::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 autooffset_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.
Public Static Attributes
-
template<typename
T
>
constexpr size_telement_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
>
structVec
¶ 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
>
constexprVec
(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.