00001
00002
00011 #ifndef ATHCONTAINERS_TOOLS_ELEMENTPROXY_H
00012 #define ATHCONTAINERS_TOOLS_ELEMENTPROXY_H
00013
00014
00015 #include "AthContainers/OwnershipPolicy.h"
00016 #include "AthLinks/tools/selection_ns.h"
00017 #include <memory>
00018
00019
00020
00021 ENTER_ROOT_SELECTION_NS
00022 namespace DataModel_detail {
00023 template <class DVL> class ElementProxy;
00024 }
00025 EXIT_ROOT_SELECTION_NS
00026
00027
00028 namespace DataModel_detail {
00029
00030
00049 template <class DVL>
00050 class ElementProxy
00051 {
00052 public:
00059 ElementProxy (typename DVL::BaseContainer::iterator i,
00060 DVL* container);
00061
00062
00074 ElementProxy& operator= (const ElementProxy& rhs);
00075
00076
00087 ElementProxy& operator= (typename DVL::value_type rhs);
00088
00089
00090 #if __cplusplus > 201100
00091 #ifndef __REFLEX__
00092
00101 ElementProxy& operator= (std::unique_ptr<typename DVL::base_value_type> rhs);
00102 #endif
00103 #endif
00104
00105
00111 operator typename DVL::value_type const() const;
00112
00113
00119 typename DVL::value_type const operator-> () const;
00120
00121
00122
00126 DVL* container() const;
00127
00128
00129 typedef typename
00130 ROOT_SELECTION_NS::DataModel_detail::ElementProxy<DVL>::self
00131 self;
00132
00133
00134 private:
00136 typename DVL::BaseContainer::iterator m_proxied;
00137
00139 DVL* m_container;
00140 };
00141
00142
00143 }
00144
00145
00146 ENTER_ROOT_SELECTION_NS
00147
00148 namespace DataModel_detail {
00149
00150 #if ROOT_VERSION_CODE < ROOT_VERSION( 5, 99, 0 )
00151
00152 template <class DVL>
00153 class ElementProxy
00154 {
00155 public:
00156 typedef ElementProxy<DVL> self;
00157 ROOT_SELECTION_NS::NO_SELF_AUTOSELECT dum2;
00158 ROOT_SELECTION_NS::TRANSIENT m_proxied;
00159 ROOT_SELECTION_NS::TRANSIENT m_container;
00160 };
00161
00162 #else
00163
00164 template <class DVL>
00165 class ElementProxy
00166 #if ROOT_VERSION_CODE > ROOT_VERSION( 6, 0, 2 )
00167 : public SelectNoInstance
00168 #endif
00169 {
00170 public:
00171 typedef ElementProxy<DVL> self;
00172 ROOT_SELECTION_NS::MemberAttributes< kTransient > m_proxied;
00173 ROOT_SELECTION_NS::MemberAttributes< kTransient > m_container;
00174 };
00175
00176 #endif // ROOT_VERSION
00177
00178 }
00179
00180 EXIT_ROOT_SELECTION_NS
00181
00182
00183 #include "AthContainers/tools/ElementProxy.icc"
00184
00185
00186 #endif // not ATHCONTAINERS_TOOLS_ELEMENTPROXY_H