ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthLinks
AthLinks
tools
SGELVRef.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ATHLINKS_TOOLS_SGELVREF_H
6
#define ATHLINKS_TOOLS_SGELVREF_H
7
8
#include "AthLinks/DataLink.h"
9
#include "AthLinks/ElementLink.h"
10
#include <algorithm>
11
#include <exception>
12
#include <functional>
13
#include <vector>
14
15
16
17
template
<
typename
DOBJ>
18
class
ElementLinkVector
;
19
25
26
namespace
SG
{
27
template
<
typename
DOBJ>
28
class
ELVRef
29
{
30
public
:
31
typedef
typename
std::vector< DataLink<DOBJ> >
DataLinkVector
;
32
typedef
ElementLinkVector<DOBJ>
ElemLinkVec
;
33
typedef
ElementLink<DOBJ>
ElemLink
;
34
typedef
typename
ElemLink::IndexingPolicy
IndexingPolicy
;
35
typedef
typename
ElemLink::ElementConstPointer
ElementConstPointer
;
36
typedef
typename
ElemLink::index_type
index_type
;
37
typedef
typename
ElemLink::stored_index_type
stored_index_type
;
38
typedef
typename
ElemLink::ID_type
ID_type
;
39
41
ELVRef
(
const
ELVRef
& rhs);
43
ELVRef
&
operator=
(
const
ELVRef
& rhs);
45
ELVRef
(
const
ElemLink
&
link
=
ElemLink
());
47
ELVRef
(
typename
DataLinkVector::size_type hostIndex,
48
index_type
elementIndex
,
49
const
ElemLinkVec
& owner);
51
ID_type
dataID
()
const
;
53
index_type
elementIndex
()
const
;
55
ElementConstPointer
cptr
()
const
{
return
m_link
.cptr(); }
56
58
const
ElemLink
&
elementLink
()
const
{
return
m_link
; }
59
61
62
bool
operator ==
(
const
ELVRef
& rhs)
const
{
63
return
( (
index
() == rhs.
index
()) && (
dataID
() == rhs.
dataID
()) );
64
}
65
bool
operator <
(
const
ELVRef
& rhs)
const
{
66
return
( (
index
() < rhs.
index
()) ||
67
( (
index
() == rhs.
index
()) && (
dataID
() < rhs.
dataID
()) ) );
68
}
69
70
72
bool
toPersistent
(
const
ElemLinkVec
& owner);
73
bool
toPersistent
(
const
ElemLinkVec
& owner,
74
typename
DataLinkVector::size_type& shortref);
75
bool
toTransient
(
const
ElemLinkVec
& owner);
76
bool
doRemap
();
77
78
const
stored_index_type
&
index
()
const
79
{
80
return
m_index
;
81
}
82
83
private
:
84
85
//Transient members only.
86
ElemLink
m_link
;
87
88
// Persistent members:
89
typename
DataLinkVector::size_type
m_shortRef
;
90
91
stored_index_type
m_index
;
92
};
93
}
94
#endif
// not ATHLINKS_TOOLS_SGELVREF_H
ElementLink< DOBJ >::stored_index_type
uint32_t stored_index_type
Definition
AthLinks/ElementLinkBase.h:76
ElementLinkVector
ElementLinkVector implementation for standalone ROOT.
Definition
AthLinks/ElementLinkVector.h:64
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
ElementLink< DOBJ >::ElementConstPointer
TypeTools::Copy< value_type >::const_pointer ElementConstPointer
Definition
A/AthLinks/ElementLink.h:71
ElementLink< DOBJ >::ID_type
std::string ID_type
Definition
A/AthLinks/ElementLink.h:47
ElementLink< DOBJ >::index_type
size_t index_type
Definition
A/AthLinks/ElementLink.h:57
SG::ELVRef::dataID
ID_type dataID() const
dataID of the host
SG::ELVRef::m_link
ElemLink m_link
Definition
SGELVRef.h:86
SG::ELVRef::ID_type
ElemLink::ID_type ID_type
Definition
SGELVRef.h:38
SG::ELVRef::operator==
bool operator==(const ELVRef &rhs) const
Definition
SGELVRef.h:62
SG::ELVRef::ElemLinkVec
ElementLinkVector< DOBJ > ElemLinkVec
Definition
SGELVRef.h:32
SG::ELVRef::m_index
stored_index_type m_index
! index of the host dobj
Definition
SGELVRef.h:91
SG::ELVRef::index
const stored_index_type & index() const
Definition
SGELVRef.h:78
SG::ELVRef::cptr
ElementConstPointer cptr() const
element pointer in ElementLink
Definition
SGELVRef.h:55
SG::ELVRef::m_shortRef
DataLinkVector::size_type m_shortRef
! the element pointer
Definition
SGELVRef.h:89
SG::ELVRef::IndexingPolicy
ElemLink::IndexingPolicy IndexingPolicy
Definition
SGELVRef.h:34
SG::ELVRef::ELVRef
ELVRef(typename DataLinkVector::size_type hostIndex, index_type elementIndex, const ElemLinkVec &owner)
Constructor from indices.
SG::ELVRef::operator=
ELVRef & operator=(const ELVRef &rhs)
STL required.
SG::ELVRef::ElementConstPointer
ElemLink::ElementConstPointer ElementConstPointer
Definition
SGELVRef.h:35
SG::ELVRef::elementLink
const ElemLink & elementLink() const
get the corresponding ElementLink. O(1)
Definition
SGELVRef.h:58
SG::ELVRef::elementIndex
index_type elementIndex() const
index into container (non-const, calculates and sets on demand):
SG::ELVRef::ELVRef
ELVRef(const ELVRef &rhs)
STL required.
SG::ELVRef::toPersistent
bool toPersistent(const ElemLinkVec &owner)
called by handlers to change state:
SG::ELVRef::index_type
ElemLink::index_type index_type
Definition
SGELVRef.h:36
SG::ELVRef::DataLinkVector
std::vector< DataLink< DOBJ > > DataLinkVector
Definition
SGELVRef.h:31
SG::ELVRef::ElemLink
ElementLink< DOBJ > ElemLink
Definition
SGELVRef.h:33
SG::ELVRef::toPersistent
bool toPersistent(const ElemLinkVec &owner, typename DataLinkVector::size_type &shortref)
SG::ELVRef::stored_index_type
ElemLink::stored_index_type stored_index_type
Definition
SGELVRef.h:37
SG::ELVRef::toTransient
bool toTransient(const ElemLinkVec &owner)
SG::ELVRef::ELVRef
ELVRef(const ElemLink &link=ElemLink())
standard constructor
SG::ELVRef::doRemap
bool doRemap()
SG::ELVRef::operator<
bool operator<(const ELVRef &rhs) const
Definition
SGELVRef.h:65
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::link
pointer & link(pointer p) const
Return a reference to the link for an element.
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0