docs
Loading...
Searching...
No Matches
Holders.h
Go to the documentation of this file.
1///
2/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3/// A license is required for commercial use. https://ultralig.ht
4///
5#pragma once
8
9#include <memory>
10
11namespace ultralight {
12namespace dom {
13namespace data {
14
15///
16/// Whether or not the library can hold an object through H (the same concept as
17/// dom::LockableHolder).
18///
19/// RefPtr, WeakPtr, std::shared_ptr, std::weak_ptr, and std::unique_ptr qualify without setup.
20/// To use your own smart pointer, specialize ultralight::HolderTraits (see
21/// `<Ultralight/HolderTraits.h>`).
22///
23using ultralight::dom::LockableHolder;
24
25///
26/// Whether or not Context::Bind() can bind an instance through H.
27///
28/// H must be a LockableHolder whose object type is described (see TypeTraits), eg,
29/// `std::shared_ptr<HUD>`, `RefPtr<HUD>`, or `std::weak_ptr<HUD>`. Each Context::Sync() locks the
30/// holder while it reads the instance. Once the object is gone, the binding stops updating and
31/// the page keeps the values it last got.
32///
33/// @note The smart-pointer receiver forms of Binding::OnChange() and Binding::OnAction() need
34/// only a LockableHolder.
35///
36template <typename H>
39
40} // namespace data
41} // namespace dom
42} // namespace ultralight
Whether or not the DOM API can hold an object through H (ignoring const and references),...
Definition Holders.h:41
Whether or not Context::Bind() can bind an instance through H.
Definition Holders.h:37
Whether or not T has a schema (ignoring const, volatile, and references), ie.
Definition TypeTraits.h:163
Data-binding API that connects native C++ data to HTML and CSS markup.
Definition ActionInfo.h:13
Direct C++ access to modify page elements and handle events.
Root namespace for every public Ultralight type, function, and enumeration.