MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ find()

std::optional< uint32_t > MayaFlux::Portal::Forma::Layer::find ( std::string_view name) const
nodiscard

The id of the first element with this name, or nullopt.

Names are labels and are not required to be unique, so the first match in registration order wins. An empty name never matches.

Definition at line 290 of file Layer.cpp.

291{
292 if (name.empty())
293 return std::nullopt;
294 const auto found = std::ranges::find_if(m_elements,
295 [name](const Element& element) { return element.name == name; });
296 if (found == m_elements.end())
297 return std::nullopt;
298 return found->id;
299}
std::vector< Element > m_elements
Definition Layer.hpp:334

References MayaFlux::Portal::Forma::Element::id, m_elements, and MayaFlux::Portal::Forma::Element::name.