vecmem 1.26.0
Loading...
Searching...
No Matches
async_sizes.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2025-2026 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8#pragma once
9
10// Local include(s).
11#include "vecmem/containers/vector.hpp"
12#include "vecmem/utils/abstract_event.hpp"
13
14// System include(s).
15#include <memory>
16#include <type_traits>
17
18namespace vecmem {
19
24template <typename SIZE_TYPE>
26
27public:
34 std::add_lvalue_reference_t<std::add_const_t<storage_type>>;
36 using event_type = std::unique_ptr<abstract_event>;
37
44
49 const_reference get() const;
50
57
60
63 void wait() override;
64
69 bool is_ready() const override;
70
72 void ignore() override;
73
75
76private:
78 storage_type m_sizes;
80 event_type m_event;
81
82}; // class async_sizes
83
84} // namespace vecmem
85
86// Include the implementation.
87#include "vecmem/utils/impl/async_sizes.ipp"
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Return type for asynchronous size vector retrievals.
Definition async_sizes.hpp:25
bool is_ready() const override
Function checking whether the event is complete without blocking.
Definition async_sizes.ipp:43
std::add_lvalue_reference_t< std::add_const_t< storage_type > > const_reference
Constant (lvalue) reference to the stored size.
Definition async_sizes.hpp:34
void wait() override
Function that would block the current thread until the event is complete.
Definition async_sizes.ipp:37
std::unique_ptr< abstract_event > event_type
Type of the held event.
Definition async_sizes.hpp:36
void ignore() override
Function telling the object not to wait for the underlying event.
Definition async_sizes.ipp:49
const_reference get() const
Access the async/future value.
Definition async_sizes.ipp:20
vector< size_type > storage_type
Underlying type that stores the size variables on the heap.
Definition async_sizes.hpp:31
const_reference unsafe_get() const
Access the async/future value without waiting for completion Completion must be ensured by the user.
Definition async_sizes.ipp:28
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
Interface that language specific "events" need to implement.
Definition abstract_event.hpp:21