|
1 | 1 | /* VecMem project, part of the ACTS project (R&D line)
|
2 | 2 | *
|
3 |
| - * (c) 2024 CERN for the benefit of the ACTS project |
| 3 | + * (c) 2024-2025 CERN for the benefit of the ACTS project |
4 | 4 | *
|
5 | 5 | * Mozilla Public License Version 2.0
|
6 | 6 | */
|
|
9 | 9 | namespace vecmem {
|
10 | 10 | namespace edm {
|
11 | 11 |
|
12 |
| -template <typename... VARTYPES, details::proxy_type PTYPE, |
13 |
| - details::proxy_access CTYPE> |
| 12 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 13 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
14 | 14 | template <typename PARENT>
|
15 |
| -VECMEM_HOST_AND_DEVICE proxy<schema<VARTYPES...>, PTYPE, CTYPE>::proxy( |
16 |
| - PARENT& parent, typename PARENT::size_type index) |
17 |
| - : m_data{ |
18 |
| - details::proxy_data_creator<schema<VARTYPES...>, PTYPE, CTYPE>::make( |
19 |
| - index, parent)} { |
| 15 | +VECMEM_HOST_AND_DEVICE proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, |
| 16 | + PTYPE>::proxy(PARENT& parent, |
| 17 | + typename PARENT::size_type index) |
| 18 | + : m_data{details::proxy_data_creator<schema<VARTYPES...>, PDOMAIN, PACCESS, |
| 19 | + PTYPE>::make(index, parent)} { |
20 | 20 |
|
21 |
| - static_assert(CTYPE == details::proxy_access::non_constant, |
| 21 | + static_assert(PACCESS == details::proxy_access::non_constant, |
22 | 22 | "This constructor is meant for non-const proxies.");
|
23 | 23 | }
|
24 | 24 |
|
25 |
| -template <typename... VARTYPES, details::proxy_type PTYPE, |
26 |
| - details::proxy_access CTYPE> |
| 25 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 26 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
27 | 27 | template <typename PARENT>
|
28 |
| -VECMEM_HOST_AND_DEVICE proxy<schema<VARTYPES...>, PTYPE, CTYPE>::proxy( |
29 |
| - const PARENT& parent, typename PARENT::size_type index) |
30 |
| - : m_data{ |
31 |
| - details::proxy_data_creator<schema<VARTYPES...>, PTYPE, CTYPE>::make( |
32 |
| - index, parent)} { |
| 28 | +VECMEM_HOST_AND_DEVICE proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, |
| 29 | + PTYPE>::proxy(const PARENT& parent, |
| 30 | + typename PARENT::size_type index) |
| 31 | + : m_data{details::proxy_data_creator<schema<VARTYPES...>, PDOMAIN, PACCESS, |
| 32 | + PTYPE>::make(index, parent)} { |
33 | 33 |
|
34 |
| - static_assert(CTYPE == details::proxy_access::constant, |
| 34 | + static_assert(PACCESS == details::proxy_access::constant, |
35 | 35 | "This constructor is meant for constant proxies.");
|
36 | 36 | }
|
37 | 37 |
|
38 |
| -template <typename... VARTYPES, details::proxy_type PTYPE, |
39 |
| - details::proxy_access CTYPE> |
| 38 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 39 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
| 40 | +template <details::proxy_domain OPDOMAIN, details::proxy_access OPACCESS, |
| 41 | + details::proxy_type OPTYPE> |
| 42 | +VECMEM_HOST_AND_DEVICE |
| 43 | +proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::proxy( |
| 44 | + const proxy<schema<VARTYPES...>, OPDOMAIN, OPACCESS, OPTYPE>& other) |
| 45 | + : m_data(other.variables()) {} |
| 46 | + |
| 47 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 48 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
| 49 | +VECMEM_HOST_AND_DEVICE |
| 50 | +proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::proxy( |
| 51 | + typename details::proxy_var_type<VARTYPES, proxy_domain, access_type, |
| 52 | + proxy_type>::type... data) |
| 53 | + : m_data(data...) {} |
| 54 | + |
| 55 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 56 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
| 57 | +template <details::proxy_domain OPDOMAIN, details::proxy_access OPACCESS, |
| 58 | + details::proxy_type OPTYPE> |
| 59 | +VECMEM_HOST_AND_DEVICE proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>& |
| 60 | +proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::operator=( |
| 61 | + const proxy<schema<VARTYPES...>, OPDOMAIN, OPACCESS, OPTYPE>& other) { |
| 62 | + |
| 63 | + if (static_cast<const void*>(this) != static_cast<const void*>(&other)) { |
| 64 | + m_data = other.variables(); |
| 65 | + } |
| 66 | + return *this; |
| 67 | +} |
| 68 | + |
| 69 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 70 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
40 | 71 | template <std::size_t INDEX>
|
41 | 72 | VECMEM_HOST_AND_DEVICE
|
42 |
| - typename details::proxy_var_type_at<INDEX, PTYPE, CTYPE, |
| 73 | + typename details::proxy_var_type_at<INDEX, PDOMAIN, PACCESS, PTYPE, |
43 | 74 | VARTYPES...>::return_type
|
44 |
| - proxy<schema<VARTYPES...>, PTYPE, CTYPE>::get() { |
| 75 | + proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::get() { |
45 | 76 |
|
46 | 77 | return vecmem::get<INDEX>(m_data);
|
47 | 78 | }
|
48 | 79 |
|
49 |
| -template <typename... VARTYPES, details::proxy_type PTYPE, |
50 |
| - details::proxy_access CTYPE> |
| 80 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 81 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
51 | 82 | template <std::size_t INDEX>
|
52 | 83 | VECMEM_HOST_AND_DEVICE
|
53 |
| - typename details::proxy_var_type_at<INDEX, PTYPE, CTYPE, |
| 84 | + typename details::proxy_var_type_at<INDEX, PDOMAIN, PACCESS, PTYPE, |
54 | 85 | VARTYPES...>::const_return_type
|
55 |
| - proxy<schema<VARTYPES...>, PTYPE, CTYPE>::get() const { |
| 86 | + proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::get() const { |
56 | 87 |
|
57 | 88 | return vecmem::get<INDEX>(m_data);
|
58 | 89 | }
|
59 | 90 |
|
| 91 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 92 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
| 93 | +VECMEM_HOST_AND_DEVICE auto |
| 94 | +proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::variables() const |
| 95 | + -> const tuple_type& { |
| 96 | + |
| 97 | + return m_data; |
| 98 | +} |
| 99 | + |
| 100 | +template <typename... VARTYPES, details::proxy_domain PDOMAIN, |
| 101 | + details::proxy_access PACCESS, details::proxy_type PTYPE> |
| 102 | +VECMEM_HOST_AND_DEVICE auto |
| 103 | +proxy<schema<VARTYPES...>, PDOMAIN, PACCESS, PTYPE>::variables() |
| 104 | + -> tuple_type& { |
| 105 | + |
| 106 | + return m_data; |
| 107 | +} |
| 108 | + |
60 | 109 | } // namespace edm
|
61 | 110 | } // namespace vecmem
|
0 commit comments