ATLAS Offline Software
Loading...
Searching...
No Matches
ElementProxy.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4*/
11
12
13#ifndef ATHCONTAINERS_TOOLS_ELEMENTPROXY_H
14#define ATHCONTAINERS_TOOLS_ELEMENTPROXY_H
15
16
18#include <memory>
19#include <RootMetaSelection.h>
20
21
22// Forward declarations.
23namespace ROOT { namespace Meta { namespace Selection {
24 namespace DataModel_detail {
25 template <class DVL> class ElementProxy;
26 }
27}}}
28
29
30namespace DataModel_detail {
31
32
51template <class DVL>
53{
54public:
61 ElementProxy (typename DVL::BaseContainer::iterator i,
62 DVL* container);
63
64
66 ElementProxy (const ElementProxy&) = default;
67
68
81
82
93 // Disable this method if the container must own its elements.
94 // In that case, only the unique_ptr overload is relevant.
95 template <bool = true>
96 requires(!DVL::must_own)
98 operator= (typename DVL::value_type rhs);
99
100
110 ElementProxy& operator= (typename DVL::unique_type rhs);
111
112
118 operator typename DVL::value_type const() const;
119
120
126 typename DVL::value_type const operator-> () const;
127
128
129
133 DVL* container();
134
135
139 const DVL* container() const;
140
141
142 typedef typename
145
146
147private:
149 typename DVL::BaseContainer::iterator m_proxied;
150
153};
154
155
156} // namespace DataModel_detail
157
158
159namespace ROOT { namespace Meta { namespace Selection {
160
161namespace DataModel_detail {
162
163template <class DVL> class ElementProxy : public SelectNoInstance
164{
165public:
167 ROOT::Meta::Selection::MemberAttributes< kTransient > m_proxied;
168 ROOT::Meta::Selection::MemberAttributes< kTransient > m_container;
169};
170
171}
172}}} // ROOT namespace
173
174
176
177
178#endif // not ATHCONTAINERS_TOOLS_ELEMENTPROXY_H
DVL::value_type const operator->() const
Conversion to a (const) pointer.
ElementProxy(typename DVL::BaseContainer::iterator i, DVL *container)
Constructor.
ElementProxy & operator=(const ElementProxy &rhs)
Assignment operator, from an Element proxy.
ElementProxy(const ElementProxy &)=default
Default copy.
const DVL * container() const
Return the container holding the element that this object proxies.
ROOT::Meta::Selection::DataModel_detail::ElementProxy< ConstDataVector >::self self
ConstDataVector::BaseContainer::iterator m_proxied
ROOT::Meta::Selection::MemberAttributes< kTransient > m_container
ROOT::Meta::Selection::MemberAttributes< kTransient > m_proxied
Selection rules: declare transient members.
Definition DataVector.h:581