Template Struct StorageAccessor¶
Defined in File storage_accessor.hpp
Struct Documentation¶
-
template<typename
Impl
>
structripple
::
StorageAccessor
¶ The StorageAccessor struct defines an interface for all classes which access storage using compile time indices, where the compile time indices are used to access the Ith type in the storage, and for storage where the Ith type is a vectortype, the Jth element.
The StorageAccessor types defines an interface for all classes which access storage using compile time indices, where the compile time indices are used to access the Ith type in the storage for N type, and for storage where the Ith type is an array type, also any of the J elements.
- Template Parameters
Impl
: The implementation of the interface.
Public Functions
-
template<typename
Other
>
autocopy
(const Other &other) noexcept -> void¶ Explicitly copies the data from the other storage type.
- Parameters
other
: The other storage type tto copy from.
- Template Parameters
ImplOhter
: The type of the other storage.
-
template<size_t
I
>
constexpr autocomponents_of
() const noexcept -> size_t¶ Returns the number of components in the Ith type being stored.
For non-indexable types this will always return 1, otherwise will return the number of possible components which can be indexed.
- Return
The number of components in the Ith element.
- Template Parameters
I
: The index of the type to get the number of components for.
-
template<size_t
I
>
decltype(auto)get
() noexcept¶ Gets a reference to the Ith data type which is stored.
- Return
A reference to the Ith type.
- Template Parameters
I
: The index of the type to get the data from.
-
template<size_t
I
>
decltype(auto)get
() const noexcept¶ Gets a const reference to the Ith data type which is stored.
- Return
A const reference to the Ith type.
- Template Parameters
I
: The index of the type to get the data from.
-
template<size_t
I
, size_tJ
>
decltype(auto)get
() noexcept¶ Gets a reference to the Jth element in the Ith data type which is stored.
- Note
The implementation should ensure that calling this with indices I, J which results in incorrect access causes a compile time error. For example if the Ith type is an int, for which there is no J element, then this should cause a compile time error.
- Return
A reference to the Jth component of the Ith type.
- Template Parameters
I
: The index of the type to get the data from.J
: The index of the element in the type to get.
-
template<size_t
I
, size_tJ
>
decltype(auto)get
() const noexcept¶ Gets a const reference to the Jth element in the Ith data type which is stored.
- Note
The implementation should ensure that calling this with indices I, J which results in incorrect access causes a compile time error. For example if the Ith type is an int, for which there is no J element, then this should cause a compile time error.
- Return
A const reference to the Jth component of the Ith type.
- Template Parameters
I
: The index of the type to get the data from.J
: The index of the element in the type to get.
-
template<size_t
I
>
decltype(auto)get
(size_t j) noexcept¶ Gets a reference to the jth element in the Ith data type which is stored.
- Return
A reference to the jth component of the Ith type.
- Parameters
j
: The index of the element in the type to get.
- Template Parameters
I
: The index of the type to get the data from.
-
template<size_t
I
>
decltype(auto)get
(size_t j) const noexcept¶ Gets a reference to the jth element in the Ith data type which is stored.
- Return
A const reference to the jth component of the Ith type.
- Parameters
j
: The index of the element in the type to get.
- Template Parameters
I
: The index of the type to get the data from.