iris::build::Field< V, D, P > Class Template Reference
Doxygen 1.15.0 generates this reference during each site build from the public headers. The C++ guide shows the API in use.
A typed handle to an entry: its name, the type of its leaves, its number of array levels, and whether it may be undefined. More...
#include <iris/handle.hpp>
Public Types | |
| using | Value = V |
| The value type. | |
Public Member Functions | |
| constexpr | Field (std::string_view name) |
| A handle to the entry called name, which must outlive the handle. | |
| constexpr std::string_view | name () const |
| Return the name of the entry. | |
| View< V, D, P > | view (const Data &data) const |
| Return the entry of data through this handle. | |
| template<class I, class B = build::Indexing> | |
| auto | operator[] (I &&index) const |
| In a builder expression, element index of this entry (<iris/build.hpp>). | |
| template<class B = build::Indexing> | |
| auto | dynamic () const |
| In a builder expression, this entry with its type and depth forgotten (<iris/build.hpp>). | |
Static Public Attributes | |
| static constexpr std::size_t | depth = D |
| The number of array levels, or dynamic_depth. | |
| static constexpr Presence | presence = P |
| Whether the entry may be undefined. | |
Detailed Description
class iris::build::Field< V, D, P >
A typed handle to an entry: its name, the type of its leaves, its number of array levels, and whether it may be undefined.
Data::get returns the entry through the handle as the View for V, D and P: an integer, a span of integers, an Array of depth 2, and so on, wrapped in std::optional when P is Presence::Maybe. A handle is a literal type, so it can be declared constexpr for an entry that a spec is known to define. The builder in <iris/build.hpp> returns handles from its statements and takes them in expressions.
- Template Parameters
-
V the value type (see HandleValue) D the number of array levels, or dynamic_depth P whether the entry may be undefined
Member Typedef Documentation
Value
| using iris::Field< V, D, P >::Value = V |
The value type.
Constructor & Destructor Documentation
Field()
|
inlineexplicitconstexpr |
A handle to the entry called name, which must outlive the handle.
Member Function Documentation
dynamic()
|
inlinenodiscard |
In a builder expression, this entry with its type and depth forgotten (<iris/build.hpp>).
name()
|
inlinenodiscardconstexpr |
Return the name of the entry.
operator[]()
|
inlinenodiscard |
In a builder expression, element index of this entry (<iris/build.hpp>).
view()
|
inlinenodiscard |
Return the entry of data through this handle.
Throws AccessError if a required entry is missing, or if the entry has another type or depth. Data::get calls it.
Member Data Documentation
depth
|
staticconstexpr |
The number of array levels, or dynamic_depth.
presence
|
staticconstexpr |
Whether the entry may be undefined.