ATLAS Offline Software
|
Proxy for ElementLink. More...
#include <ELProxy.h>
Public Types | |
using | Cont_t = typename BASE::Cont_t |
Get the Storable from the base class. More... | |
using | Link_t = ElementLink< Cont_t > |
The ElementLink class we provide. More... | |
using | PLink_t = SG::PackedLink< Cont_t > |
The PackedLink class we proxy. More... | |
Public Member Functions | |
ELProxyT (const ELProxyT &)=delete | |
Don't allow these proxy objects to be copied. More... | |
ELProxyT & | operator= (const ELProxyT &)=delete |
ELProxyT (PLink_t &pl, PackedLinkConverter< Cont_t > &cnv) | |
Constructor. More... | |
ELProxyT (PLink_t &pl, AuxVectorData &container, SG::auxid_t auxid, SG::auxid_t linked_auxid) | |
Constructor. More... | |
operator const Link_t () const | |
Convert the held PackedLink to an ElementLink . More... | |
const Link_t | operator= (const Link_t &link) |
Update the held PackedLink from an ElementLink . More... | |
bool | operator== (const Link_t &l) const |
Equality comparison with ElementLink. More... | |
bool | operator== (const ELProxyT &p) const |
Equality comparison with another proxy. More... | |
Private Attributes | |
PLink_t & | m_pl |
The proxied PackedLink . More... | |
Proxy for ElementLink.
We want to be able to do things like:
That means that the Accessor
cannot return an ElementLink
directly. Rather, it needs to return a proxy object. This proxy should both be convertible to an ElementLink
and be able to be assigned from an ElementLnk
. In the latter case, it should then update the underlying PackedLink
value.
This object can be used as such a proxy. It holds a reference to the PackedLink
and also (via the base class) an appropriate converter. It handles conversions to ElementLink
and assignment from ElementLink
. It also proxies all the const methods of ElementLink
.
Now, in the case where we have an proxy by itself, we want the proxy to hold a converter by value. But if the proxy is part of a span, then we want it to have just a reference to the converter, with the converter itself being stored in the span (that would be in the ELSpanProxy
object below). That's not just to save space — the converter holds a span over the DataLinks
, and if that changes, we want it visible by all members of the proxy span. So how we hold the converter is factored out into the BASE
class, which will be one of the two classes above.
using SG::detail::ELProxyT< BASE >::Cont_t = typename BASE::Cont_t |
using SG::detail::ELProxyT< BASE >::Link_t = ElementLink<Cont_t> |
The ElementLink
class we provide.
using SG::detail::ELProxyT< BASE >::PLink_t = SG::PackedLink<Cont_t> |
|
delete |
Don't allow these proxy objects to be copied.
SG::detail::ELProxyT< BASE >::ELProxyT | ( | PLink_t & | pl, |
PackedLinkConverter< Cont_t > & | cnv | ||
) |
Constructor.
pl | PackedLink object to proxy. |
cnv | Converter to use. |
SG::detail::ELProxyT< BASE >::ELProxyT | ( | PLink_t & | pl, |
AuxVectorData & | container, | ||
SG::auxid_t | auxid, | ||
SG::auxid_t | linked_auxid | ||
) |
Constructor.
container | Container holding the variables. |
auxid | The ID of the PackedLink variable. |
linked_auxid | The ID of the linked DataLinks. |
This constructor can only be used if the converter is being held by value.
SG::detail::ELProxyT< BASE >::operator const Link_t | ( | ) | const |
Convert the held PackedLink
to an ElementLink
.
|
delete |
const Link_t SG::detail::ELProxyT< BASE >::operator= | ( | const Link_t & | link | ) |
Update the held PackedLink
from an ElementLink
.
link | The ElementLink from which to update. |
bool SG::detail::ELProxyT< BASE >::operator== | ( | const ELProxyT< BASE > & | p | ) | const |
Equality comparison with another proxy.
l | The proxy with which to compare. |
(Default conversions don't suffice to make this work.)
bool SG::detail::ELProxyT< BASE >::operator== | ( | const Link_t & | l | ) | const |
Equality comparison with ElementLink.
l | The link with which to compare. |
(Default conversions don't suffice to make this work.)
|
private |