Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 */
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.
23 namespace ROOT { namespace Meta { namespace Selection {
24  namespace DataModel_detail {
25  template <class DVL> class ElementProxy;
26  }
27 }}}
28 
29 
30 namespace DataModel_detail {
31 
32 
51 template <class DVL>
53 {
54 public:
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
144  self;
145 
146 
147 private:
150 
153 };
154 
155 
156 } // namespace DataModel_detail
157 
158 
159 namespace ROOT { namespace Meta { namespace Selection {
160 
161 namespace DataModel_detail {
162 
163 template <class DVL> class ElementProxy : public SelectNoInstance
164 {
165 public:
166  typedef ElementProxy<DVL> self;
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
DataModel_detail::ElementProxy::container
DVL * container()
Return the container holding the element that this object proxies.
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DataModel_detail::ElementProxy::container
const DVL * container() const
Return the container holding the element that this object proxies.
ElementProxy.icc
DataModel_detail::ElementProxy::m_proxied
DVL::BaseContainer::iterator m_proxied
Iterator pointing at the proxied element.
Definition: ElementProxy.h:149
lumiFormat.i
int i
Definition: lumiFormat.py:85
DataModel_detail::ElementProxy::ElementProxy
ElementProxy(typename DVL::BaseContainer::iterator i, DVL *container)
Constructor.
OwnershipPolicy.h
DataModel_detail
Definition: CompareAndPrint.h:15
ROOT::Meta::Selection::DataModel_detail::ElementProxy
Definition: ElementProxy.h:25
DataModel_detail::ElementProxy::requires
requires(!DVL::must_own) ElementProxy< DVL > &operator
Assignment operator, from a pointer.
DataModel_detail::ElementProxy::operator=
ElementProxy & operator=(const ElementProxy &rhs)
Assignment operator, from an Element proxy.
ROOT::Meta::Selection::DataModel_detail::ElementProxy::m_container
ROOT::Meta::Selection::MemberAttributes< kTransient > m_container
Definition: ElementProxy.h:168
DataModel_detail::ElementProxy::ElementProxy
ElementProxy(const ElementProxy &)=default
Default copy.
DataModel_detail::ElementProxy::m_container
DVL * m_container
The container that it references.
Definition: ElementProxy.h:152
ROOT::Meta::Selection::DataModel_detail::ElementProxy::m_proxied
ROOT::Meta::Selection::MemberAttributes< kTransient > m_proxied
Definition: ElementProxy.h:167
DataModel_detail::ElementProxy
Proxy for lvalue access to DataVector/DataList elements.
Definition: ElementProxy.h:53
DataModel_detail::ElementProxy::operator->
DVL::value_type const operator->() const
Conversion to a (const) pointer.
ROOT
Selection rules: declare transient members.
Definition: DataVector.h:580