1#include <vector_functions.hpp>
2#include <muda/ext/field/sub_field.h>
6template <FieldEntryLayout Layout>
7FieldBuilder<Layout>::~FieldBuilder()
15template <FieldEntryLayout Layout>
17FieldEntry<T, Layout, 1, 1>& FieldBuilder<Layout>::EntryProxy::scalar() &&
19 return m_builder.create_entry<T, 1, 1>(m_name, FieldEntryType::Scalar);
22template <FieldEntryLayout Layout>
23template <
typename T,
int N>
24FieldEntry<T, Layout, N, 1>& FieldBuilder<Layout>::EntryProxy::vector() &&
26 static_assert(N >= 2,
"When N == 1, use scalar() instead");
27 return m_builder.create_entry<T, N, 1>(m_name, FieldEntryType::Vector);
30template <FieldEntryLayout Layout>
32FieldEntry<T, Layout, 2, 1>& FieldBuilder<Layout>::EntryProxy::vector2() &&
34 return std::move(*this).template vector<T, 2>();
37template <FieldEntryLayout Layout>
39FieldEntry<T, Layout, 3, 1>& FieldBuilder<Layout>::EntryProxy::vector3() &&
41 return std::move(*this).template vector<T, 3>();
43template <FieldEntryLayout Layout>
45FieldEntry<T, Layout, 4, 1>& FieldBuilder<Layout>::EntryProxy::vector4() &&
47 return std::move(*this).template vector<T, 4>();
50template <FieldEntryLayout Layout>
51template <
typename T,
int M,
int N>
52FieldEntry<T, Layout, M, N>& FieldBuilder<Layout>::EntryProxy::matrix() &&
54 return m_builder.create_entry<T, M, N>(m_name, FieldEntryType::Matrix);
57template <FieldEntryLayout Layout>
59FieldEntry<T, Layout, 2, 2>& FieldBuilder<Layout>::EntryProxy::matrix2x2() &&
61 return std::move(*this).template matrix<T, 2, 2>();
64template <FieldEntryLayout Layout>
66FieldEntry<T, Layout, 3, 3>& FieldBuilder<Layout>::EntryProxy::matrix3x3() &&
68 return std::move(*this).template matrix<T, 3, 3>();
71template <FieldEntryLayout Layout>
73FieldEntry<T, Layout, 4, 4>& FieldBuilder<Layout>::EntryProxy::matrix4x4() &&
75 return std::move(*this).template matrix<T, 4, 4>();
78template <FieldEntryLayout Layout>
79template <
typename T,
int M,
int N>
80FieldEntry<T, Layout, M, N>& FieldBuilder<Layout>::create_entry(std::string_view name,
83 return m_subfield.template create_entry<T, Layout, M, N>(
84 name, m_layout, type, make_uint2(
static_cast<uint32_t
>(M),
static_cast<uint32_t
>(N)));
87template <FieldEntryLayout Layout>
88auto FieldBuilder<Layout>::entry(std::string_view name) -> EntryProxy
90 MUDA_ASSERT(m_single_entry ==
false,
"Named entry and Anonymous entry should not appear together!")
91 return EntryProxy{*
this, name};
94template <FieldEntryLayout Layout>
95auto FieldBuilder<Layout>::entry() -> EntryProxy
97 MUDA_ASSERT(m_subfield.num_entries() == 0,
98 "Anonymous entry should be the only entry in a SubField!");
99 m_single_entry =
true;
100 return EntryProxy{*
this, m_subfield.name()};
103template <FieldEntryLayout Layout>
106 m_subfield.build(m_options);
void build()
Finish building the field.
Definition field_builder.inl:104