Skip to content
Snippets Groups Projects
Commit 9ece1f52 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'initCondKey.StoreGate-20190318' into 'master'

StoreGate: Update CondHandleKey::initialize() to match VarHandleKey().

See merge request atlas/athena!21998
parents 94a6c99d eb0c41f7
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#ifndef STOREGATE_CONDHANDLEKEY_H
......@@ -25,7 +25,8 @@ namespace SG {
// CondHandleKey& operator= (const std::string& sgkey);
StatusCode initialize();
StatusCode initialize(bool used = true);
StatusCode initialize (AllowEmptyEnum);
const std::string& dbKey() const { return m_dbKey; }
void setDbKey(const std::string& dbKey) { m_dbKey = dbKey; }
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
#include "AthenaKernel/StoreID.h"
......@@ -24,13 +24,14 @@ namespace SG {
template <class T>
StatusCode
CondHandleKey<T>::initialize() {
CondHandleKey<T>::initialize(bool used /*= true*/) {
if (m_isInit) return StatusCode::SUCCESS;
if (VarHandleKey::initialize() != StatusCode::SUCCESS) {
if (VarHandleKey::initialize(used) != StatusCode::SUCCESS) {
return StatusCode::FAILURE;
}
if (empty()) return StatusCode::SUCCESS;
if (!m_cs.isValid()) {
MsgStream msg(Athena::getMessageSvc(), "CondHandleKey");
......@@ -94,6 +95,14 @@ namespace SG {
}
template <class T>
StatusCode
CondHandleKey<T>::initialize(AllowEmptyEnum) {
if (key().empty()) {
return StatusCode::SUCCESS;
}
return initialize (true);
}
//---------------------------------------------------------------------------
template <class T>
......
......@@ -50,7 +50,8 @@ namespace SG {
const_pointer_type retrieve( const EventIDBase& t);
const_pointer_type operator->() { return retrieve(); }
const_pointer_type operator*() { return retrieve(); }
const_pointer_type operator*() { return retrieve(); }
const_pointer_type cptr() { return retrieve(); }
bool isValid();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment