MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Reflect::RecordBinding< Input, Source, Access > Class Template Reference

Bind described attributes and configured child collections of a source element. More...

#include <RecordBinding.hpp>

Collaboration diagram for MayaFlux::Reflect::RecordBinding< Input, Source, Access >:

Classes

struct  ChildBinding

Public Member Functions

RecordBinding & ignore (std::initializer_list< std::string_view > names)
 Leave these attributes to other readers of the same element.
RecordBinding & ignore_child (std::string child_name)
 Leave every child element of this name to another reader.
RecordBinding & ignore_prefix (std::string prefix)
 Leave every attribute whose name begins with a prefix to other readers.
std::optional< Input > read (const Source &source, std::string &error, uint64_t *error_location=nullptr) const
 Decode the source element into a new Input.
template<auto Pointer>
RecordBinding & repeated (std::string child_name, std::string defaults_name={}, std::string required_item_attribute={}, size_t minimum=0)
RecordBinding & required (std::string name)

Private Member Functions

bool is_ignored (std::string_view name) const

Static Private Member Functions

static bool has_children (const Source &source)
static std::string label (const Source &source)
template<Described T>
static bool overlay (T &target, const Source &source, std::string &error)

Private Attributes

std::vector< ChildBinding > m_children
std::vector< std::string > m_ignored
std::vector< std::string > m_ignored_children
std::vector< std::string > m_ignored_prefixes
std::vector< std::string > m_required

Detailed Description

template<Described Input, typename Source, typename Access = RecordAccess<Source>>
class MayaFlux::Reflect::RecordBinding< Input, Source, Access >

Bind described attributes and configured child collections of a source element.

Attributes overlay onto the described Input by member name. Required attributes, ignored attributes and repeated children with shared defaults are configured on the binding. Any source with a RecordAccess specialization can be bound.

Definition at line 30 of file RecordBinding.hpp.


The documentation for this class was generated from the following file: