Skip to content
Snippets Groups Projects
Commit 3688c801 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'proxyCast.AthenaKernel-20200826' into 'master'

AthenaKernel: Use static_cast to DataBucket.

See merge request atlas/athena!35928
parents 86fff1cb 75634202
No related branches found
No related tags found
No related merge requests found
......@@ -54,4 +54,3 @@ void* DataBucketBase::cast (CLID /*clid*/,
{
return cast (tinfo, irt, isConst);
}
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ATHENAKERNEL_STORABLECONVERSIONS_H
......@@ -186,7 +186,6 @@ namespace SG {
bool isConst /*= true*/)
{
typedef typename std::remove_const<T>::type T_nc;
typedef typename DataBucketTrait<T_nc>::type bucket_t;
DataBucketTrait<T_nc>::init();
//check inputs
......@@ -200,19 +199,11 @@ namespace SG {
}
// get T* from DataBucket:
SG::DataBucket<T_nc>* bucketPtr = dynamic_cast<bucket_t*>(pDObj);
bool success(0 != bucketPtr);
if (success)
pTrans = *bucketPtr;
else {
// Try to use BaseInfo information to convert pointers.
DataBucketBase* b = dynamic_cast<DataBucketBase*>(pDObj);
if (b) {
pTrans = b->template cast<T_nc> (irt, isConst);
if (pTrans)
success = true;
}
}
// All objects in the event store nowadays are instances
// of DataBucket, so just do a static_cast.
DataBucketBase* b = static_cast<DataBucketBase*>(pDObj);
pTrans = b->template cast<T_nc> (irt, isConst);
bool success = pTrans != nullptr;
#ifndef NDEBUG
if (!quiet && !success) {
......
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