ATLAS Offline Software
|
Determine dependent types for ElementLink
classes.
More...
#include "AthLinks/ElementLinkBase.h"
#include "AthLinks/tools/IsSTLSequence.h"
#include "AthLinks/tools/ForwardIndexingPolicy.h"
#include "AthLinks/tools/GenerateIndexingPolicy.h"
#include "AthLinks/GenericElementLinkBase.h"
Go to the source code of this file.
Classes | |
class | SG::ElementLinkTraits1< STORABLE, VALUE_TYPE, IS_SEQUENCE > |
ElementLink classes for the generic case. More... | |
class | SG::ElementLinkTraits1< STORABLE, BASE_VALUE_TYPE *, true > |
ElementLink classes for the case of a vector-like container of pointers. More... | |
class | SG::ElementLinkTraits< STORABLE > |
ElementLinkTraits class to specialize. More... | |
Namespaces | |
SG | |
Forward declaration. | |
Macros | |
#define | ELEMENTLINK_FWD(TYPE, VALUE_TYPE) |
Forward declaration helper for ElementLink. More... | |
Determine dependent types for ElementLink
classes.
ElementLink
class needs to store the index of the referenced element; it also caches a copy of the element itself. In general, these can be arbitrary types, and so the data members for them must be in a templated class.However, by far the most common use of ElementLink
is to refer to an element in a vector-like container of pointers. In that case, we can get away with storing the persistent data in a non-templated class, and in fact that makes direct ROOT I/O much easier.
So, what we do is factor out all the state of ElementLink
into a base class. For the generic case, we use the templated GenericElementLinkBase
class. However, for the case of a vector of pointers, we use instead the non-templated class ElementLinkBase
. The choice of which base class to use is made by the traits class defined here, ElementLinkTraits
.
An ElementLink
must also be associated with an indexing policy class. The traits class also provides the appropriate indexing policy; in general, this is generated by GenerateIndexingPolicy
, but for the specialized case, we always use ForwardIndexingPolicy
.
See below for the interfaces that must be supplied by the ElementLink
base classes and by the indexing policy.
Definition in file ElementLinkTraits.h.
#define ELEMENTLINK_FWD | ( | TYPE, | |
VALUE_TYPE | |||
) |
Forward declaration helper for ElementLink.
This macro helps in declaring an ElementLink to a container with an incomplete definition (that has been forward declared). Restriction: The container must be a vector-like container of pointers. Must not be used inside a namespace.
See comments in ElementLink.h for a usage example.
Definition at line 216 of file ElementLinkTraits.h.