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

The values of one attribute across a tree, each claimed by one element. More...

#include <AttributeChecks.hpp>

Inheritance diagram for MayaFlux::Reflect::AttributeIndex< Source, Access >:
Collaboration diagram for MayaFlux::Reflect::AttributeIndex< Source, Access >:

Public Member Functions

const std::string & attribute () const noexcept
 AttributeIndex (std::string attribute)
bool claim (const Source &source, std::string &error)
 Claim the attribute's value for an element.
bool contains (std::string_view value) const
std::optional< uint64_t > location_of (std::string_view value) const
 The location of the element that holds a value, or nullopt.

Private Attributes

std::string m_attribute
std::map< std::string, uint64_t, std::less<> > m_claimed

Detailed Description

template<typename Source, typename Access = RecordAccess<Source>>
class MayaFlux::Reflect::AttributeIndex< Source, Access >

The values of one attribute across a tree, each claimed by one element.

Claiming a value records the element that holds it, and a second claim of the same value is refused with the location of the first. It serves any source with a RecordAccess, so the same check holds for an XML document, a script or any other element tree.

Usage:

std::string error;
for (const Element& element : elements) {
if (!ids.claim(element, error))
return false;
}
AttributeIndex(std::string attribute)
Template Parameters
SourceElement type with a RecordAccess specialization.

Definition at line 38 of file AttributeChecks.hpp.


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