![]() |
ATLAS Offline Software
|
#include "AthLinks/tools/ElementLinkTraits.h"#include "AthLinks/DataLink.h"#include <utility>#include "AthLinks/ElementLink.icc"Go to the source code of this file.
Classes | |
| struct | std::pair< ElementLink< CONT >, T2 > |
Specialization for a pair containing an ElementLink, allowing for faster initialization. More... | |
Namespaces | |
| namespace | SG_detail |
| namespace | std |
| STL namespace. | |
Functions | |
| static CLID | classID () |
| bool | SG_detail::checkForRemap (IProxyDict *sg, SG::sgkey_t sgkey_in, size_t index_in, SG::sgkey_t &sgkey_out, size_t &index_out) |
| See if an EL is being remapped. | |
| template<class T> | |
| bool | SG_detail::checkForRemap (IProxyDict *sg, SG::sgkey_t sgkey_in, const T &, SG::sgkey_t &sgkey_out, T &) |
| See if an EL is being remapped. | |
Constructors. | |
| ElementLink () | |
| Default constructor. | |
| ElementLink (const ID_type &dataID, index_type elemID, IProxyDict *sg=0) | |
| Construct a link from a string storable key and an index. | |
| ElementLink (const ID_type &dataID, index_type elemID, const EventContext &ctx) | |
| Construct a link from a string storable key and an index. | |
| ElementLink (sgkey_t key, index_type elemID, IProxyDict *sg=0) | |
| Construct a link from a hashed storable key and an index. | |
| ElementLink (sgkey_t key, index_type elemID, const EventContext &ctx) | |
| Construct a link from a hashed storable key and an index. | |
| ElementLink (const ID_type &dataID, index_type elemID, ElementType pEl, IProxyDict *sg=0) | |
| Construct from a string storable key, index, AND pointer to element. | |
| ElementLink (const ID_type &dataID, index_type elemID, ElementType pEl, const EventContext &ctx) | |
| Construct from a string storable key, index, AND pointer to element. | |
| ElementLink (sgkey_t key, index_type elemID, ElementType pEl, IProxyDict *sg=0) | |
| Construct from a hashed storable key, index, AND pointer to element. | |
| ElementLink (sgkey_t key, index_type elemID, ElementType pEl, const EventContext &ctx) | |
| Construct from a hashed storable key, index, AND pointer to element. | |
| ElementLink (BaseConstReference data, index_type elemID, IProxyDict *sg=0) | |
| Construct a link from an index and reference to the container. | |
| ElementLink (BaseConstReference data, index_type elemID, const EventContext &ctx) | |
| Construct a link from an index and reference to the container. | |
| ElementLink (const ElementType &element, BaseConstReference data, IProxyDict *sg=0) | |
| Construct from an element and reference to the container. | |
| ElementLink (const ElementType &element, BaseConstReference data, const EventContext &ctx) | |
| Construct from an element and reference to the container. | |
| ElementLink (const ElementLink &other, index_type elemID) | |
| Construct a link from another link, changing the index. | |
| ElementLink (const DataLink< STORABLE > &dlink, index_type index) | |
| Construct a link from a DataLink and an index. | |
| template<class U> | |
| ElementLink (const ElementLink< U > &other) | |
| Constructor allowing a derived -> base conversion. | |
| ElementLink (const ElementLink &)=default | |
| ElementLink & | operator= (const ElementLink &)=default |
Dereferencing the link. | |
| const_pointer | getDataPtr () const |
| Return a pointer to the currently-referenced container object. | |
| pointer | getDataNonConstPtr () |
| Return a pointer to the currently-referenced container object. | |
| DataLink< STORABLE > | getDataLink () |
| Return a link to the currently-referenced container object. | |
| BaseConstPointer | getStorableObjectPointer () const |
| Return a pointer to the currently-referenced container object. | |
| BaseConstReference | getStorableObjectRef () const |
| Return a reference to the currently-referenced container object. | |
| ElementConstPointer | cptr () const |
| Return a pointer to the referenced element. | |
| ElementConstReference | operator* () const |
| Return a reference to the referenced element. | |
| ElementConstPointer | operator-> () const |
| Return a pointer to the referenced element. | |
| operator ElementConstPointer () const | |
| Convert to a pointer to the referenced element. | |
| bool | isValid () const |
| Test to see if the link can be dereferenced. | |
| bool | operator! () const |
| Test to see if the link can not be dereferenced. | |
| ElementType | cachedElement () const |
| Return the cached element, if any. | |
Modifying the link. | |
| bool | toIndexedElement (BaseConstReference data, index_type elemID, IProxyDict *sg=0) |
| Set the link to an element given by index and pointer to container. | |
| bool | toIndexedElement (BaseConstReference data, index_type elemID, const EventContext &ctx) |
| Set the link to an element given by index and pointer to container. | |
| bool | toContainedElement (BaseConstReference data, ElementType element, IProxyDict *sg=0) |
| Set from element pointer and a reference to the container (storable). | |
| bool | toContainedElement (BaseConstReference data, ElementType element, const EventContext &ctx) |
| Set from element pointer and a reference to the container (storable). | |
| bool | setElement (ElementType element) |
| Set to point to an element. | |
| bool | setStorableObject (BaseConstReference data, bool replace=false, IProxyDict *sg=0) |
| Set link to point to a new container (storable). | |
| bool | setStorableObject (BaseConstReference data, bool replace, const EventContext &ctx) |
| Set link to point to a new container (storable). | |
| void | resetWithKeyAndIndex (const ID_type &dataID, index_type elemID, IProxyDict *sg=0) |
| Set the link to an element given by string key and index. | |
| void | resetWithKeyAndIndex (const ID_type &dataID, index_type elemID, const EventContext &ctx) |
| Set the link to an element given by string key and index. | |
| void | resetWithKeyAndIndex (sgkey_t key, index_type elemID, IProxyDict *sg=0) |
| Set the link to an element given by string key and index. | |
| void | resetWithKeyAndIndex (sgkey_t key, index_type elemID, const EventContext &ctx) |
| Set the link to an element given by string key and index. | |
| const void * | storable () const |
| Return a (void) pointer to the currently-referenced container object. | |
| void * | storableNonConst () |
| Return a (void) pointer to the currently-referenced container object. | |
| template<typename STORABLE> | |
| bool | operator< (const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs) |
Ordering relation for ElementLink (less-than). | |
| template<typename STORABLE> | |
| bool | operator> (const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs) |
Ordering relation for ElementLink (greater-than). | |
| template<typename STORABLE> | |
| bool | operator== (const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs) |
Equality relation for ElementLink. | |
| template<typename STORABLE> | |
| bool | operator!= (const ElementLink< STORABLE > &lhs, const ElementLink< STORABLE > &rhs) |
Inequality relation for ElementLink. | |
| ElementType cachedElement | ( | ) | const |
Return the cached element, if any.
|
static |
| ElementConstPointer cptr | ( | ) | const |
Return a pointer to the referenced element.
Be aware: if the element is a pointer, then this will yield a pointer to a pointer.
| ElementLink | ( | ) |
Default constructor.
Makes a null link.
| ElementLink | ( | BaseConstReference | data, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
| ElementLink | ( | BaseConstReference | data, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Construct a link from an index and reference to the container.
O(1)
| data | Reference to the container (storable). |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If sg is 0, we take the global default.
| ElementLink | ( | const DataLink< STORABLE > & | dlink, |
| index_type | index ) |
|
default |
| ElementLink | ( | const ElementLink & | other, |
| index_type | elemID ) |
Construct a link from another link, changing the index.
| other | The source link. |
| elemID | The index for the new link. |
The index being constructed will reference the same container as other, but it will refer to element elemID.
| ElementLink | ( | const ElementLink< U > & | other | ) |
Constructor allowing a derived -> base conversion.
Construct from an element and reference to the container.
O(N)
| element | The element to reference. |
| data | Reference to the container (storable). |
| ctx | Event context for this link. |
Does the same thing as the default ctor followed by toContainedElement. Note the reversed parameter order compared to the previous constructor. This is to prevent ambiguities in the case that the contained type is convertable to an int.
Will throw SG::ExcElementNotFound if the element is not in the container.
| ElementLink | ( | const ElementType & | element, |
| BaseConstReference | data, | ||
| IProxyDict * | sg = 0 ) |
Construct from an element and reference to the container.
O(N)
| element | The element to reference. |
| data | Reference to the container (storable). |
| sg | Associated store. |
Does the same thing as the default ctor followed by toContainedElement. Note the reversed parameter order compared to the previous constructor. This is to prevent ambiguities in the case that the contained type is convertable to an int.
Will throw SG::ExcElementNotFound if the element is not in the container.
If sg is 0, we take the global default.
| ElementLink | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
Construct a link from a string storable key and an index.
O(1)
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| ctx | Event context for this link. |
| ElementLink | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| ElementType | pEl, | ||
| const EventContext & | ctx ) |
Construct from a string storable key, index, AND pointer to element.
O(1)
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| pEl | Pointer to the element. |
| ctx | Event context for this link. |
USE CAREFULLY: no coherency checks, we just trust you!
| ElementLink | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| ElementType | pEl, | ||
| IProxyDict * | sg = 0 ) |
Construct from a string storable key, index, AND pointer to element.
O(1)
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| pEl | Pointer to the element. |
| sg | Associated store. |
USE CAREFULLY: no coherency checks, we just trust you!
If sg is 0, we take the global default.
| ElementLink | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Construct a link from a string storable key and an index.
O(1)
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If sg is 0, we take the global default.
| ElementLink | ( | sgkey_t | key, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
Construct a link from a hashed storable key and an index.
O(1)
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| ctx | Event context for this link. |
| ElementLink | ( | sgkey_t | key, |
| index_type | elemID, | ||
| ElementType | pEl, | ||
| const EventContext & | ctx ) |
Construct from a hashed storable key, index, AND pointer to element.
O(1)
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| pEl | Pointer to the element. |
| ctx | Event context for this link. |
USE CAREFULLY: no coherency checks, we just trust you!
| ElementLink | ( | sgkey_t | key, |
| index_type | elemID, | ||
| ElementType | pEl, | ||
| IProxyDict * | sg = 0 ) |
Construct from a hashed storable key, index, AND pointer to element.
O(1)
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| pEl | Pointer to the element. |
| sg | Associated store. |
USE CAREFULLY: no coherency checks, we just trust you!
If sg is 0, we take the global default.
| ElementLink | ( | sgkey_t | key, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Construct a link from a hashed storable key and an index.
O(1)
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If sg is 0, we take the global default.
Return a link to the currently-referenced container object.
| pointer getDataNonConstPtr | ( | ) |
Return a pointer to the currently-referenced container object.
| const_pointer getDataPtr | ( | ) | const |
Return a pointer to the currently-referenced container object.
| BaseConstPointer getStorableObjectPointer | ( | ) | const |
Return a pointer to the currently-referenced container object.
| BaseConstReference getStorableObjectRef | ( | ) | const |
Return a reference to the currently-referenced container object.
| bool isValid | ( | ) | const |
Test to see if the link can be dereferenced.
Will throw an exception if the container is not empty and the referenced element cannot be retrieved.
| operator ElementConstPointer | ( | ) | const |
Convert to a pointer to the referenced element.
| bool operator! | ( | ) | const |
Test to see if the link can not be dereferenced.
|
private |
Inequality relation for ElementLink.
| ElementConstReference operator* | ( | ) | const |
Return a reference to the referenced element.
Will throw an exception if the link is not valid.
| ElementConstPointer operator-> | ( | ) | const |
Return a pointer to the referenced element.
|
private |
Ordering relation for ElementLink (less-than).
|
default |
|
private |
Equality relation for ElementLink.
|
private |
Ordering relation for ElementLink (greater-than).
| void resetWithKeyAndIndex | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
Set the link to an element given by string key and index.
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| ctx | The event context. |
| void resetWithKeyAndIndex | ( | const ID_type & | dataID, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Set the link to an element given by string key and index.
| dataID | Key of the object. |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
| void resetWithKeyAndIndex | ( | sgkey_t | key, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
Set the link to an element given by string key and index.
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| ctx | The event context. |
| void resetWithKeyAndIndex | ( | sgkey_t | key, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Set the link to an element given by string key and index.
| key | Hashed key of the object. |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
| bool setElement | ( | ElementType | element | ) |
Set to point to an element.
| element | The element. |
The collection and the element can be specified independently using setElement and setStorableObject.
If the link is already set, this will return false and leave the link unchanged.
| bool setStorableObject | ( | BaseConstReference | data, |
| bool | replace, | ||
| const EventContext & | ctx ) |
Set link to point to a new container (storable).
| data | Reference to the container (storable). |
| replace | True if we can change an existing link. |
| ctx | The event context. |
If the link is already set, this will return false and leave the link unchanged unless replace is set. The replace argument should be set if the element is now in a new storable container; e.g. element ptr has been put in a new view container.
| bool setStorableObject | ( | BaseConstReference | data, |
| bool | replace = false, | ||
| IProxyDict * | sg = 0 ) |
Set link to point to a new container (storable).
| data | Reference to the container (storable). |
| replace | True if we can change an existing link. |
| sg | Associated store. |
If the link is already set, this will return false and leave the link unchanged unless replace is set. The replace argument should be set if the element is now in a new storable container; e.g. element ptr has been put in a new view container.
If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
|
private |
Return a (void) pointer to the currently-referenced container object.
|
private |
Return a (void) pointer to the currently-referenced container object.
| bool toContainedElement | ( | BaseConstReference | data, |
| ElementType | element, | ||
| const EventContext & | ctx ) |
Set from element pointer and a reference to the container (storable).
| data | Reference to the container (storable). |
| element | The element. |
| ctx | The event context. |
O(N) for sequences!
If the link is already set, this will return false and leave the link unchanged.
| bool toContainedElement | ( | BaseConstReference | data, |
| ElementType | element, | ||
| IProxyDict * | sg = 0 ) |
Set from element pointer and a reference to the container (storable).
| data | Reference to the container (storable). |
| element | The element. |
| sg | Associated store. |
O(N) for sequences!
If the link is already set, this will return false and leave the link unchanged.
If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.
| bool toIndexedElement | ( | BaseConstReference | data, |
| index_type | elemID, | ||
| const EventContext & | ctx ) |
Set the link to an element given by index and pointer to container.
| data | Reference to the container (storable). |
| elemID | The index of the element within the container. |
| ctx | The event context. |
If the link is already set, this will return false and leave the link unchanged.
| bool toIndexedElement | ( | BaseConstReference | data, |
| index_type | elemID, | ||
| IProxyDict * | sg = 0 ) |
Set the link to an element given by index and pointer to container.
| data | Reference to the container (storable). |
| elemID | The index of the element within the container. |
| sg | Associated store. |
If the link is already set, this will return false and leave the link unchanged.
If sg is 0, then we take the store from whatever the link's currently set to. If the link has no current store, then we take the global default.