Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::StyleRoleRegistration Class Reference

UI-thread scoped registration; the engine retains only a weak observer. Copies share participation. Dropping the last copy retires it without callbacks; use unregisterRoles for explicit paint invalidation while the node remains live. Retained palette snapshots own their data and never assert that a node is live. More...

#include <style.hpp>

Public Member Functions

 StyleRoleRegistration ()=default
 Empty allocation-free handle.
std::shared_ptr< const StyleRolePalette > snapshot () const noexcept
std::uint64_t revision () const noexcept

Friends

class StyleEngine
struct detail::StyleRoleTestAccess

Detailed Description

UI-thread scoped registration; the engine retains only a weak observer. Copies share participation. Dropping the last copy retires it without callbacks; use unregisterRoles for explicit paint invalidation while the node remains live. Retained palette snapshots own their data and never assert that a node is live.

Member Function Documentation

◆ revision()

std::uint64_t portals::StyleRoleRegistration::revision ( ) const
noexcept
Returns
Last publication revision; zero for empty/retired handles or foreign-thread observation.

◆ snapshot()

std::shared_ptr< const StyleRolePalette > portals::StyleRoleRegistration::snapshot ( ) const
noexcept
Returns
Last immutable projection, or null after explicit unregister/engine destruction. Foreign-thread observation returns null; a copied palette remains valid after retirement.

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