ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
StoreGate
SGObjectWithVersion.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
3
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
9
#ifndef STOREGATE_SGOBJECTWITHVERSION_H
10
#define STOREGATE_SGOBJECTWITHVERSION_H 1
11
12
#include "
SGTools/SGVersionedKey.h
"
13
#include "
StoreGate/ReadHandle.h
"
14
namespace
SG
{
19
template
<
typename
T>
20
class
ObjectWithVersion
{
21
public
:
22
ObjectWithVersion
():
versionedKey
(),
dataObject
() {}
23
ObjectWithVersion
(
const
ObjectWithVersion
& rhs):
24
versionedKey
(rhs.
versionedKey
),
dataObject
(rhs.
dataObject
) {}
25
ObjectWithVersion
(
const
VersionedKey
& vk,
const
SG::ReadHandle<T>
& dh):
26
versionedKey
(vk),
dataObject
(dh) {}
27
ObjectWithVersion
(
const
VersionedKey
& vk,
SG::DataProxy
* proxy):
28
versionedKey
(vk),
dataObject
(proxy) {}
29
ObjectWithVersion
&
operator=
(
const
ObjectWithVersion
& rhs)
30
{
31
if
(
this
!= &rhs) {
32
versionedKey
= rhs.
versionedKey
;
33
dataObject
= rhs.
dataObject
;
34
}
35
return
*
this
;
36
}
37
SG::VersionedKey
versionedKey
;
38
SG::ReadHandle<T>
dataObject
;
39
};
40
}
42
template
<
typename
T>
43
bool
operator <
(
const
SG::ObjectWithVersion<T>
& lhs,
44
const
SG::ObjectWithVersion<T>
& rhs) {
45
return
(lhs.
versionedKey
< rhs.
versionedKey
);
46
}
47
48
#endif
operator<
bool operator<(const SG::ObjectWithVersion< T > &lhs, const SG::ObjectWithVersion< T > &rhs)
sort according to highest key version
Definition
SGObjectWithVersion.h:43
SGVersionedKey.h
defines a StoreGateSvc key with a version number
ReadHandle.h
Handle class for reading from StoreGate.
SG::DataProxy
Definition
DataProxy.h:45
SG::ObjectWithVersion
associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retriev...
Definition
SGObjectWithVersion.h:20
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion(const VersionedKey &vk, SG::DataProxy *proxy)
Definition
SGObjectWithVersion.h:27
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion()
Definition
SGObjectWithVersion.h:22
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion(const VersionedKey &vk, const SG::ReadHandle< T > &dh)
Definition
SGObjectWithVersion.h:25
SG::ObjectWithVersion::dataObject
SG::ReadHandle< T > dataObject
Definition
SGObjectWithVersion.h:38
SG::ObjectWithVersion::operator=
ObjectWithVersion & operator=(const ObjectWithVersion &rhs)
Definition
SGObjectWithVersion.h:29
SG::ObjectWithVersion::versionedKey
SG::VersionedKey versionedKey
Definition
SGObjectWithVersion.h:37
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion(const ObjectWithVersion &rhs)
Definition
SGObjectWithVersion.h:23
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::VersionedKey
a StoreGateSvc key with a version number.
Definition
SGVersionedKey.h:31
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0