docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
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
6
#include <
Ultralight/dom/Holders.h
>
7
#include <
Ultralight/dom/data/TypeTraits.h
>
8
9
#include <memory>
10
11
namespace
ultralight
{
12
namespace
dom
{
13
namespace
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
///
23
using
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
///
36
template
<
typename
H>
37
concept
BindableHolder
=
LockableHolder<H>
38
&&
Described<typename HolderTraits<std::remove_cvref_t<H>
>::element_type>;
39
40
}
// namespace data
41
}
// namespace dom
42
}
// namespace ultralight
Holders.h
ultralight::dom::LockableHolder
Whether or not the DOM API can hold an object through H (ignoring const and references),...
Definition
Holders.h:41
ultralight::dom::data::BindableHolder
Whether or not Context::Bind() can bind an instance through H.
Definition
Holders.h:37
ultralight::dom::data::Described
Whether or not T has a schema (ignoring const, volatile, and references), ie.
Definition
TypeTraits.h:163
TypeTraits.h
ultralight::dom::data
Data-binding API that connects native C++ data to HTML and CSS markup.
Definition
ActionInfo.h:13
ultralight::dom
Direct C++ access to modify page elements and handle events.
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
Ultralight
dom
data
Holders.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4