ATLAS Offline Software
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
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion(const VersionedKey &vk, SG::DataProxy *proxy)
Definition:
SGObjectWithVersion.h:27
StateLessPT_NewConfig.proxy
proxy
Definition:
StateLessPT_NewConfig.py:392
SG
Forward declaration.
Definition:
CaloCellPacker_400_500.h:32
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
SG::ObjectWithVersion::operator=
ObjectWithVersion & operator=(const ObjectWithVersion &rhs)
Definition:
SGObjectWithVersion.h:29
SGVersionedKey.h
PyPoolBrowser.dh
dh
Definition:
PyPoolBrowser.py:102
operator<
bool operator<(const SG::ObjectWithVersion< T > &lhs, const SG::ObjectWithVersion< T > &rhs)
sort according to highest key version
Definition:
SGObjectWithVersion.h:43
SG::VersionedKey
a StoreGateSvc key with a version number. Notice that StoreGate does not order multiple instances of ...
Definition:
SGVersionedKey.h:31
SG::ObjectWithVersion::versionedKey
SG::VersionedKey versionedKey
Definition:
SGObjectWithVersion.h:37
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion()
Definition:
SGObjectWithVersion.h:22
SG::ObjectWithVersion::ObjectWithVersion
ObjectWithVersion(const ObjectWithVersion &rhs)
Definition:
SGObjectWithVersion.h:23
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
ReadHandle.h
Handle class for reading from StoreGate.
SG::ObjectWithVersion
associate a data object with its VersionedKey The object is held by a ReadHandle to delay its retriev...
Definition:
SGVersionedKey.h:17
SG::DataProxy
Definition:
DataProxy.h:45
Generated on Sun Dec 22 2024 21:18:03 for ATLAS Offline Software by
1.8.18