iris::ValueRef Class 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 borrowed view of a value read, or of the part of it that a path selects. More...
#include <iris/data.hpp>
Public Member Functions | |
| ValueType | type () const |
| Return the type of the leaves. | |
| std::size_t | depth () const |
| Return the number of array levels, 0 for a single value. | |
| std::size_t | size () const |
| Return the number of elements of this array. | |
| ValueRef | operator[] (std::size_t i) const |
| Return element i of this array, counted from 0. | |
| ValueRef | at (std::span< const std::size_t > path) const |
| Return the part that path selects, one index per level. | |
| ValueRef | at (std::initializer_list< std::size_t > path) const |
| Return the part that the braced path selects, as in at({1, 0}). | |
| std::int64_t | integer () const |
| Return this single integer. | |
| double | number () const |
| Return this single number, converting an integer to a float. | |
| std::string_view | text () const |
| Return this single string. | |
| std::span< const std::int64_t > | ints () const |
| Return the integers of this one-dimensional array of integers. | |
| std::span< const double > | floats () const |
| Return the floats of this one-dimensional array of floats. | |
Detailed Description
A borrowed view of a value read, or of the part of it that a path selects.
A view of depth 0 is a single value, and a view of depth d > 0 is an array whose elements are views of depth d - 1. The view stays valid while any copy of the Data it comes from exists. Misuse throws AccessError.
Member Function Documentation
at() [1/2]
|
inlinenodiscard |
Return the part that the braced path selects, as in at({1, 0}).
at() [2/2]
|
nodiscard |
Return the part that path selects, one index per level.
depth()
|
nodiscard |
Return the number of array levels, 0 for a single value.
floats()
|
nodiscard |
Return the floats of this one-dimensional array of floats.
integer()
|
nodiscard |
Return this single integer.
ints()
|
nodiscard |
Return the integers of this one-dimensional array of integers.
number()
|
nodiscard |
Return this single number, converting an integer to a float.
operator[]()
|
nodiscard |
Return element i of this array, counted from 0.
size()
|
nodiscard |
Return the number of elements of this array.
text()
|
nodiscard |
Return this single string.
type()
|
nodiscard |
Return the type of the leaves.