ATLAS Offline Software
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-2021 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 "AthLinks/tools/selection_ns.h"
19 #include "CxxUtils/concepts.h"
20 #include <memory>
21 
22 
23 // Forward declarations.
25 namespace DataModel_detail {
26 template <class DVL> class ElementProxy;
27 }
29 
30 
31 namespace DataModel_detail {
32 
33 
52 template <class DVL>
53 class ElementProxy
54 {
55 public:
63  DVL* container);
64 
65 
67  ElementProxy (const ElementProxy&) = default;
68 
69 
82 
83 
94  // Disable this method if the container must own its elements.
95  // In that case, only the unique_ptr overload is relevant.
96  ATH_MEMBER_REQUIRES(!DVL::must_own, ElementProxy&)
97  operator= (typename DVL::value_type rhs);
98 
99 
109  ElementProxy& operator= (typename DVL::unique_type rhs);
110 
111 
117  operator typename DVL::value_type const() const;
118 
119 
125  typename DVL::value_type const operator-> () const;
126 
127 
128 
132  DVL* container();
133 
134 
139 
140 
141  typedef typename
144 
145 
146 private:
149 
152 };
153 
154 
155 } // namespace DataModel_detail
156 
157 
159 
160 namespace DataModel_detail {
161 
162 template <class DVL> class ElementProxy : public SelectNoInstance
163 {
164 public:
165  typedef ElementProxy<DVL> self;
166  ROOT_SELECTION_NS::MemberAttributes< kTransient > m_proxied;
167  ROOT_SELECTION_NS::MemberAttributes< kTransient > m_container;
168 };
169 
170 }
171 
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
ATH_MEMBER_REQUIRES
#define ATH_MEMBER_REQUIRES(CONDITION, RETTYPE)
Definition: concepts.h:112
ElementProxy.icc
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
DataModel_detail::ElementProxy::m_proxied
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_proxied
Definition: ElementProxy.h:166
DataModel_detail::ElementProxy::m_proxied
DVL::BaseContainer::iterator m_proxied
Iterator pointing at the proxied element.
Definition: ElementProxy.h:148
DataModel_detail::iterator
(Non-const) Iterator class for DataVector/DataList.
Definition: DVLIterator.h:184
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
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
python.Dumpers.typename
def typename(t)
Definition: Dumpers.py:194
DataModel_detail::ElementProxy::operator=
ElementProxy & operator=(const ElementProxy &rhs)
Assignment operator, from an Element proxy.
concepts.h
Compatibility helpers for using some pieces of C++20 concepts with older compilers.
DataModel_detail::ElementProxy< DataVector< CaloCell > >::self
ROOT_SELECTION_NS::DataModel_detail::ElementProxy< DataVector< CaloCell > >::self self
Definition: ElementProxy.h:143
DataModel_detail::ElementProxy::m_container
ROOT_SELECTION_NS::MemberAttributes< kTransient > m_container
Definition: ElementProxy.h:167
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:151
DataModel_detail::ElementProxy
Proxy for lvalue access to DataVector/DataList elements.
Definition: ElementProxy.h:26
value_type
Definition: EDM_MasterSearch.h:11
xAOD::BaseContainer
DataVector< SG::AuxElement > BaseContainer
Definition: BaseContainer.h:7