MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Portal::Forma::Layer::Slot Class Reference

Handle returned by Layer::add, carrying the assigned element id. More...

#include <Layer.hpp>

+ Collaboration diagram for MayaFlux::Portal::Forma::Layer::Slot:

Public Member Functions

Slothidden ()
 Hide this element immediately after registration.
 
uint32_t id () const noexcept
 Explicit id accessor, for clarity in chained expressions.
 
Slotnon_interactive ()
 Disable hit testing for this element immediately.
 
 operator uint32_t () const noexcept
 Implicit conversion to the element id.
 
Slotrelate_to (uint32_t primary_id)
 Record that this element belongs with primary_id.
 
 Slot (Layer &layer, uint32_t id) noexcept
 
Slotto_back ()
 Move to the bottom of the hit-test order (drawn first, hit last).
 
Slotto_front ()
 Move to the top of the hit-test order (drawn last, hit first).
 

Private Attributes

uint32_t m_id
 
Layerm_layer
 

Detailed Description

Handle returned by Layer::add, carrying the assigned element id.

Provides chained post-registration mutations — relation, visibility, z-order — without requiring the caller to keep the id in a separate variable before acting on it.

Slot holds a non-owning reference to its Layer. It must not outlive the Layer. The recommended pattern is to extract the id immediately after configuration is complete and store that instead:

const uint32_t id = layer.add(std::move(el))
.relate_to(parent_id)
.hidden()
.id();

When the id is not needed, Slot converts implicitly to uint32_t so existing callsites (el.element.id = layer.add(...)) compile unchanged.

Definition at line 49 of file Layer.hpp.


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