Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::Node< T > Class Template Reference

Copyable typed observer; never owns or exposes an unchecked widget pointer. More...

#include <widget.hpp>

Public Member Functions

 Node ()=default
 Empty observer; checked access fails.
template<class U>
requires std::derived_from<U, T>
 Node (Node< U > other)
 Safe observing upcast; downcasts are unavailable.
NodeId id () const noexcept
 Copy the stable diagnostic identity.
bool operator== (const Node &other) const noexcept=default
 Compare identity.

Friends

class WidgetTree
struct ui::detail::NamedAccess

Detailed Description

template<class T = Widget>
class portals::Node< T >

Copyable typed observer; never owns or exposes an unchecked widget pointer.

Template Parameters
TWidget or a publicly derived extension type; the handle records identity without owning T.

Constructor & Destructor Documentation

◆ Node()

template<class T = Widget>
template<class U>
requires std::derived_from<U, T>
portals::Node< T >::Node ( Node< U > other)
inline

Safe observing upcast; downcasts are unavailable.

Template Parameters
UPublicly derived from T, permitting a safe observing upcast.
Parameters
otherObserver whose identity is copied; the source remains valid.

Member Function Documentation

◆ id()

template<class T = Widget>
NodeId portals::Node< T >::id ( ) const
inlinenoexcept

Copy the stable diagnostic identity.

Returns
Copied session/slot/generation identity; it does not establish liveness.

◆ operator==()

template<class T = Widget>
bool portals::Node< T >::operator== ( const Node< T > & other) const
defaultnoexcept

Compare identity.

Parameters
otherTyped observer to compare.
Returns
True when all compared fields are equal.

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