Combination of a reference to a tree compound and a single attribute. More...
#include <eagine/value_tree/wrappers.hpp>
Public Member Functions | |
compound_attribute () noexcept=default | |
Default constructor. Constructs empty attribute refering to nothing. | |
compound_attribute (compound c, attribute a) noexcept | |
Construction from a compound and attribute pair. More... | |
operator bool () const noexcept | |
Indicates if this attribute actually refers to something. | |
auto | type_id () const noexcept |
Returns the shared implementation type id of the attribute and compound. | |
auto | name () const noexcept -> string_view |
Returns the name of this attribute. | |
auto | is_link () const noexcept -> bool |
Indicates if the specified attribute is a reference or link in the tree. | |
auto | canonical_type () const -> value_type |
Returns the canonical value type of this attribute. | |
auto | nested_count () const -> span_size_t |
Returns the count of nested attributes of an attribute. More... | |
auto | has_nested () const -> span_size_t |
Indicates if an attribute has nested attribute accessible by index. | |
auto | nested (span_size_t index) const -> compound_attribute |
Returns nested attribute of an attribute at the specified index. More... | |
auto | nested (string_view name) const -> compound_attribute |
Returns nested attribute of an attribute with the specified name. More... | |
auto | find (const basic_string_path &path) const -> compound_attribute |
Returns nested attribute of an attribute at the specified path. More... | |
auto | value_count () const -> span_size_t |
Returns the number of value elements accessible through an attribute. | |
template<typename T > | |
auto | fetch_values (span_size_t offset, span< T > dest) const |
Fetches values from this attribute, starting at offset, into dest. | |
template<typename T > | |
auto | fetch_values (span< T > dest) const |
Fetches values from this attribute, into dest. | |
auto | fetch_blob (memory::block dest) const |
Fetches a BLOB from this attribute, into dest. | |
template<typename T , identifier_t V> | |
auto | fetch_value (span_size_t offset, T &dest, selector< V > sel=default_selector) const -> bool |
Fetches a value from this attribute, starting at offset, with selector. | |
template<typename T , identifier_t V> | |
auto | select_value (T &dest, selector< V > sel) const -> bool |
Fetches a value from this attribute, with selector. | |
template<typename T , identifier_t V> | |
auto | select_values (span< T > dest, selector< V > sel) const -> span< T > |
Fetches a value from this attribute, with selector, into dest. | |
template<typename T > | |
auto | fetch_value (T &dest) const -> bool |
Fetches a value from this attribute, into dest. | |
template<typename T > | |
auto | get (span_size_t offset, type_identity< T > tid={}) const |
Returns a value of type T, from this attribute, at offset. | |
template<typename T > | |
auto | get (type_identity< T > tid={}) const |
Returns a value of type T, from this attribute. | |
Combination of a reference to a tree compound and a single attribute.
This class provides a more convenient value tree access interface, at the cost of storage space.
Construction from a compound and attribute pair.
|
inline |
Returns nested attribute of an attribute at the specified path.
Returns empty attribute handle if no such nested attribute exists.
|
inline |
Returns nested attribute of an attribute at the specified index.
Returns empty attribute handle if no such nested attribute exists.
|
inline |
Returns nested attribute of an attribute with the specified name.
Returns empty attribute handle if no such nested attribute exists.
|
inline |
Returns the count of nested attributes of an attribute.