soagen namespace
The root namespace for the library.
Namespaces
- namespace examples
- Types generated by soagen for example purposes.
Classes
- struct allocator
- The default allocator used by soagen tables.
-
template <typename ValueType, size_struct column_traits
t Align = alignof(ValueType), typename ParamType = soagen:: param_type<ValueType>> - Traits for a single column of a table.
-
template <typename... Args>struct emplacer
- Helper class for #table::emplace() and #table::emplace_back().
-
template <typename Soa, size_t... Columns>class iterator
- RandomAccessIterator for SoA types.
-
template <typename Derived>struct iterator_base
- Base class for soagen::
iterator. -
template <typename Soa, size_t... Columns>struct row
- A proxy type for treating (some subset of) an SoA row as if it were a regular AoS struct.
-
template <typename Derived>struct row_base
- Base class for soagen::
row. -
template <typename Soa>class span
- A span type for representing some subset of a SoA container's rows.
-
template <typename Derived>struct span_base
- Base class for soagen::
span. -
template <typename Traits, typename Allocator = soagen::class table
allocator> - A table.
-
template <typename Derived>struct table_base
- Base class for soagen::
table. -
template <typename... Columns>struct table_traits
- Traits for a table.
Typedefs
-
template <typename T>using allocator_type =
/* ... */ - Gets the allocator being used by the soagen::
table of an SoA type. -
template <typename T>using coerce_ref = std::
conditional_t<std:: is_reference_v<T>, T, std:: add_lvalue_reference_t<T>> - Makes
TintoT&ifTwas not already a reference. -
template <typename T, auto... Columns>using column_indices =
/* ... */ - Gets the std::
index_sequence type corresponding to the columns of a type, optionally overriding them. -
template <typename T, bool Cond>using conditionally_add_const = std::
conditional_t<Cond, std:: add_const_t<T>, T> - Conditionally adds
constto a type. -
template <typename T, bool Cond>using conditionally_add_volatile = std::
conditional_t<Cond, std:: add_volatile_t<T>, T> - Conditionally adds
volatileto a type. -
template <typename T, bool Cond>using conditionally_remove_cvref = std::
conditional_t<Cond, remove_ cvref<T>, T> - Conditionally removes all cvref-qualifiers from a type.
-
template <typename T, auto... Columns>using const_iterator_type =
/* ... */ - The same as soagen::
iterator_type but promoting the base SoA type to const(if it was not already). -
template <typename T, auto... Columns>using const_row_type =
/* ... */ - The same as soagen::
row_type but promoting the base SoA type to const(if it was not already). -
template <typename T>using const_span_type =
/* ... */ - The same as soagen::
span_type but promoting the base SoA type to const(if it was not already). -
template <typename T, typename CopyFrom>using copy_cv =
/* ... */ - Copies the cv-qualifiers from one type onto another, replacing the existing ones.
-
template <typename T, typename CopyFrom>using copy_cvref =
/* ... */ - Copies the cvref-qualifiers from one type onto another, replacing the existing ones.
-
template <typename T, typename CopyFrom>using copy_ref =
/* ... */ - Copies the ref-qualifiers from one type onto another, replacing the existing ones.
-
template <typename T>using forward_type =
/* ... */ - The type that would result from
std::.forward<T>() -
template <auto Value>using index_constant = std::
integral_constant<size_ t, static_cast<size_ t>(Value)> - Alias for
std::integral_constant<std:: size_t, Value> -
template <typename T, auto... Columns>using iterator_type =
/* ... */ - The soagen::
iterator for a given type and (some subset of) its columns. -
template <typename T>using optional = std::
optional<T> - The optional type used by the library.
-
template <typename ValueType>using param_type =
/* ... */ - The default type soagen will use for a column in lvalue parameter contexts (e.g.
push_back(const&)). -
template <typename T>using remove_cvref = std::
remove_cv_t<std:: remove_reference_t<T>> - Equivalent to C+20's std::
remove_cvref_t. -
template <typename T>using remove_lvalue_ref =
/* ... */ - Removes lvalue reference qualifiers. Rvalues references are preserved as-is.
-
template <typename T, auto... Columns>using row_type =
/* ... */ - The soagen::
row for a given type and (some subset of) its columns. -
template <typename T, auto... Columns>using rvalue_iterator_type =
/* ... */ - The same as soagen::
iterator_type but promoting the base SoA type to &&(if it was not already). -
template <typename T, auto... Columns>using rvalue_row_type =
/* ... */ - The same as soagen::
row_type but promoting the base SoA type to &&(if it was not already). -
template <typename T>using rvalue_span_type =
/* ... */ - The same as soagen::
span_type but promoting the base SoA type to &&(if it was not already). -
template <typename ParamType>using rvalue_type =
/* ... */ - The type soagen will use for a column in rvalue parameter contexts (e.g.
push_back(&&)). -
template <typename T>using soa_type =
/* ... */ - Gets the root SoA type from a type (e.g.
Tinsoagen::), without any cvref-qualifiers.row<T, Cols...> -
template <typename T>using span_type =
/* ... */ - The soagen::
span for a given type. -
template <typename ValueType>using storage_type =
/* ... */ - The internal storage type soagen will use to store a column.
-
template <typename T>using table_traits_type =
/* ... */ - Gets the soagen::
table_traits for the underlying soagen:: table of a type. -
template <typename T>using table_type =
/* ... */ - Gets the underlying soagen::
table of a type. -
template <auto I, typename... T>using type_at_index =
/* ... */ - Gets the type
Tat indexIin the parameter pack. -
template <typename T, auto Column>using value_ref =
/* ... */ - Cvref-qualified version of soagen::
value_type (i.e. having cvref-qualifiers derived from T). -
template <typename T, auto Column>using value_type =
/* ... */ - Gets the soagen::
column_traits:: value_type for the selected column of a type.
Functions
-
template <typename T, typename Func>void for_each_column(T&& obj, Func&& func) noexcept(…)
- Invokes a callable once for each column in an object.
-
template <size_t I, typename T>auto get_from_tuple(T&& tuple) → decltype(auto) constexpr noexcept
- Gets the member at index
Ifrom tuple-likeT. -
template <typename T>auto get_source_offset(] const T& object) → std::
size_t constexpr noexcept - Gets the base index offset from an object.
-
template <typename... Args>void swap(table<Args...>& lhs, table<Args...>& rhs) constexpr noexcept(…)
- Swaps the contents of two tables.
Variables
-
template <typename T, auto Column>size_
t actual_alignment constexpr - Determines the actual minimum alignment for a table column.
-
template <typename... T>bool all_integer constexpr
- True if all
Tare (non-bool) integers. -
template <typename T, typename... U>bool any_same constexpr
- True if any
Uare the same asT. -
template <auto Value, auto... Values>bool any_same_value constexpr
- True if
Valueis in the listValues. -
template <typename... T>bool has_data_member constexpr
- True if all
Thave adata()member. -
template <typename T, typename... Args>bool has_emplace_back_member constexpr
- True if
Thas anemplace_back(Args...)member. -
template <typename T, typename Pos, typename... Args>bool has_emplace_member constexpr
- True if
Thas anemplace(Pos, Args...)member. -
template <typename... T>bool has_erase_member constexpr
- True if all
Thave anerase(size_t)member. -
template <typename... T>bool has_nothrow_data_member constexpr
- True if all
Thave a non-throwingdata()member. -
template <typename T, typename... Args>bool has_nothrow_emplace_back_member constexpr
- True if
Thas a non-throwingemplace_back(Args...)member. -
template <typename T, typename Pos, typename... Args>bool has_nothrow_emplace_member constexpr
- True if
Thas a non-throwingemplace(Pos, Args...)member. -
template <typename... T>bool has_nothrow_erase_member constexpr
- True if all
Thave a non-throwingerase(size_t)member. -
template <typename... T>bool has_nothrow_resize_member constexpr
- True if all
Thave a non-throwingresize(size_t)member. -
template <typename... T>bool has_nothrow_swap_member constexpr
- True if all
Thave a non-throwingswap(T&)member. -
template <typename... T>bool has_nothrow_unordered_erase_member constexpr
- True if all
Thave a non-throwingunordered_erase(size_t)member. -
template <typename... T>bool has_resize_member constexpr
- True if all
Thave aresize(size_t)member. -
template <typename T>bool has_source_offset constexpr
- True if
Thas asource_offset()member function, or one found via ADL. -
template <typename... T>bool has_swap_member constexpr
- True if all
Thave aswap(T&)member. -
template <typename... T>bool has_unordered_erase_member constexpr
- True if all
Thave anunordered_erase(size_t)member. -
template <typename T>bool is_column_traits constexpr
- True if
Tis a soagen::column_traits. -
template <typename T, typename Tuple>bool is_constructible_by_unpacking_tuple constexpr
- True if
Tis constructible from the tuple-likeTupleby unpacking its members. -
template <typename T>bool is_cv constexpr
- True if
Tisconstorvolatilequalified. -
template <typename T>bool is_cvref constexpr
- True if
Tis (or is a reference to something that is)constorvolatilequalified. -
template <template<typename...> typename Trait, typename... Args>auto is_detected constexpr
- Detects if
Traitcan be applied to a set ofArgs. -
template <typename T>bool is_emplacer constexpr
- True if
Tis an instance of soagen::emplacer. -
template <typename T, typename U = T>bool is_equality_comparable constexpr
- True if
TandUmeet theEqualityComparablenamed requirement. -
template <typename T>bool is_implicit_lifetime_type constexpr
- True if
Tmeets theImplicitLifetimeTypenamed requirement. -
template <typename T>bool is_integer constexpr
- True if
Tis a (non-bool) integer. -
template <typename Func, typename... Args>bool is_invocable constexpr
- True if
Funcis invocable withArgs. -
template <size_t I, typename Func, typename Arg>bool is_invocable_with_optional_index constexpr
- True if
Funcis invocable withArgand an optional index_constant/size_t. -
template <typename T>bool is_iterator constexpr
- True if
Tis a soagen::iterator. -
template <typename T, typename U = T>bool is_less_than_comparable constexpr
- True if
TandUmeet theLessThanComparablenamed requirement. -
template <typename T, typename U = T>bool is_nothrow_equality_comparable constexpr
- True if
TandUmeet theEqualityComparablenamed requirement without throwing. -
template <typename Func, typename... Args>bool is_nothrow_invocable constexpr
- True if
Funcis nothrow-invocable withArgs. -
template <size_t I, typename Func, typename Arg>bool is_nothrow_invocable_with_optional_index constexpr
- True if
Funcis nothrow-invocable withArgand an optional index_constant/size_t. -
template <typename T, typename U = T>bool is_nothrow_less_than_comparable constexpr
- True if
TandUmeet theLessThanComparablenamed requirement without throwing. -
template <typename T>bool is_row constexpr
- True if
Tis a soagen::row. -
template <typename T>bool is_soa constexpr
- True if
Tis a soagen::table or a soagen-generated SoA class. -
template <typename T>bool is_span constexpr
- True if
Tis a soagen::span. -
template <typename T>bool is_table constexpr
- True if
Tis a soagen::table. -
template <typename T>bool is_table_traits constexpr
- True if
Tis a soagen::table_traits. -
template <typename T>bool is_tuple constexpr
- True if
Timplements the tuple protocol. -
template <typename T>bool is_unsigned constexpr
- True if
Tis a (non-bool) unsigned integer. -
template <typename A, typename B>bool same_table_type constexpr
- True if two types have the same underlying soagen::
table type.
Typedef documentation
template <typename T>
using soagen:: allocator_type = /* ... */
Gets the allocator being used by the soagen::
| Template parameters | |
|---|---|
| T | A table, allocator, row, span, iterator, or some soagen-generated SoA class. |
template <typename T, auto... Columns>
using soagen:: column_indices = /* ... */
Gets the std::
| Template parameters | |
|---|---|
| T | A table, table_ |
| Columns | |
template <typename T, auto... Columns>
using soagen:: iterator_type = /* ... */
The soagen::
| Template parameters | |
|---|---|
| T | A table, row, span, iterator, or some soagen-generated SoA class. |
| Columns | The columns viewed by the iterator. Leave empty to copy the columns from the source. |
template <typename T>
using soagen:: optional = std:: optional<T>
The optional type used by the library.
template <typename ValueType>
using soagen:: param_type = /* ... */
The default type soagen will use for a column in lvalue parameter contexts (e.g. push_back(const&)).
Types chosen by this trait aim to be a good default:
| Move-only types | T&& |
| Small, trivially-copyable types | T |
| Everything else | const T& |
template <typename T, auto... Columns>
using soagen:: row_type = /* ... */
The soagen::
| Template parameters | |
|---|---|
| T | A table, row, span, iterator, or some soagen-generated SoA class. |
| Columns | The columns viewed by the row. Leave empty to copy the columns from the source. |
template <typename T>
using soagen:: span_type = /* ... */
The soagen::
| Template parameters | |
|---|---|
| T | A table, row, span, iterator, or some soagen-generated SoA class. |
template <typename ValueType>
using soagen:: storage_type = /* ... */
The internal storage type soagen will use to store a column.
In most cases it will be the same as the ValueType, but in some circumstances soagen is able to reduce the number of template instantiations (and thus binary size) by applying simple and safe type transformations (e.g. removing const and volatile, storing all pointer types as void*, et cetera.)
template <typename T>
using soagen:: table_traits_type = /* ... */
Gets the soagen::
| Template parameters | |
|---|---|
| T | A table, table_ |
template <typename T>
using soagen:: table_type = /* ... */
Gets the underlying soagen::
| Template parameters | |
|---|---|
| T | A table, row, span, iterator, or some soagen-generated SoA class. |
Function documentation
template <typename T, typename Func>
void soagen:: for_each_column(T&& obj,
Func&& func) noexcept(…)
Invokes a callable once for each column in an object.
| Template parameters | |
|---|---|
| T | A class type with a column<N>() template member function (e.g. tables, spans, rows). |
| Func | A callable type compatible with one of the following signatures:
Overload resolution is performed in the order listed above. |
| Parameters | |
| obj | The object to invoke the callable on for each column. |
| func | The callable to invoke. |
Variable documentation
template <typename T, auto Column>
size_ t soagen:: actual_alignment constexpr
Determines the actual minimum alignment for a table column.
This value is based on a number of factors:
- The
alignoffor the column'svalue_type, - The value specified for
column_traits::,alignment - The value specified for
allocator::(if any),min_alignment - Internal allocation semantics,
- Whether T is a soagen::
table, a soagen-generated SoA type, or some view type (e.g. spans).