Nui
make_children_update_event.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace Nui::Detail
6 {
7  inline void makeChildrenUpdateEvent(auto& observedValues, auto& childrenRefabricator, auto& createdSelfWeak)
8  {
9  const auto eventId = Nui::globalEventContext.registerEvent(Event{
10  [childrenRefabricator](int) -> bool {
11  (*childrenRefabricator)();
12  return false;
13  },
14  [createdSelfWeak]() {
15  return !createdSelfWeak.expired();
16  }});
17  observedValues.attachOneshotEvent(eventId);
18  }
19 }
EventIdType registerEvent(Event event)
Definition: event_context.hpp:52
Definition: event.hpp:40
Definition: rpc_hub.hpp:23
void makeChildrenUpdateEvent(auto &observedValues, auto &childrenRefabricator, auto &createdSelfWeak)
Definition: make_children_update_event.hpp:7
thread_local EventContext globalEventContext
Definition: event_context.cpp:5