8#include "../detail/try_result.hpp"
9#include "../thread_registry.hpp"
35 if (!registry.has_native())
36 throw std::system_error(std::make_error_code(std::errc::operation_canceled),
37 "composite_thread_registry::attach: moved-from registry");
38 implementation_.
attach(®istry.native());
45 return ::threadschedule::detail::try_result(
46 [
this]() ->
result<std::vector<registered_thread>>
48 auto entries = implementation_.
query().entries();
49 std::vector<registered_thread> result_entries;
50 result_entries.reserve(entries.size());
51 for (
auto const& entry : entries)
53 entry.std_id, entry.name, entry.component, entry.alive });
54 return result_entries;
62 return implementation_.count();
69 return implementation_.empty();
Non-owning facade that merges snapshots from multiple registries.
composite_thread_registry()=default
auto snapshot() const -> result< std::vector< registered_thread > >
Return one portable snapshot containing every attached registry.
void attach(thread_registry ®istry)
Attach a registry without transferring ownership.
auto empty() const -> bool
Whether a newly merged snapshot contains no entries.
auto count() const -> std::size_t
Number of entries in a newly merged snapshot.
composite_thread_registry(composite_thread_registry const &)=delete
auto operator=(composite_thread_registry const &) -> composite_thread_registry &=delete
auto query() const -> thread_registry_backend::query_view
void attach(thread_registry_backend *reg)
Registry for named/configurable threads.
static constexpr auto make(std::uint64_t value) -> thread_id
Snapshot entry returned by thread_registry::snapshot.