ATLAS Offline Software
RootDataBucketBranch.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // RootDataBucketBranch.cxx
8 // Implementation file for class RootDataBucketBranch
9 // Author: S.Binet<binet@cern.ch>
11 
12 // AthenaRootComps includes
13 #include "RootDataBucketBranch.h"
14 
15 // STL
16 #include <stdexcept>
17 #include <sstream>
18 
19 namespace Athena {
20 
22 {
23  //std::cerr << "::~DBB[" << m_clid << "," << name() << "]\n";
24 }
25 
26 void*
28  bool /*isConst*/)
29 {
30  // no conversion needed
31  if (allowMismatchCLID || clid == m_clid) {
32  return m_ptr;
33 
34  } else {
35  std::ostringstream err;
36  err << "cannot convert from clid ["
37  << this->clID()
38  << "] to requested ["
39  << clid
40  << "]";
41  throw std::runtime_error(err.str());
42  }
43  return 0;
44 }
45 
46 void*
47 DataBucketBranch::cast(const std::type_info& /*tinfo*/,
48  SG::IRegisterTransient* /*itr*/,
49  bool /*isConst*/)
50 {
51  return m_ptr;
52 }
53 
54 } //> namespace Athena
SG::IRegisterTransient
Interface for registering a transient object in t2p map.
Definition: IRegisterTransient.h:28
RootDataBucketBranch.h
Athena::DataBucketBranch::allowMismatchCLID
bool allowMismatchCLID
Definition: RootDataBucketBranch.h:83
Athena::DataBucketBranch::m_clid
CLID m_clid
Definition: RootDataBucketBranch.h:79
Athena::DataBucketBranch::~DataBucketBranch
virtual ~DataBucketBranch() override
Definition: RootDataBucketBranch.cxx:21
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
Athena::DataBucketBranch::cast
virtual void * cast(CLID clid, SG::IRegisterTransient *itr, bool isConst=true) override
Return the contents of the DataBucket, converted to type given by clid.
Definition: RootDataBucketBranch.cxx:27
Athena::DataBucketBranch::m_ptr
void * m_ptr
Definition: RootDataBucketBranch.h:81
Athena::DataBucketBranch::clID
virtual const CLID & clID() const override
Definition: RootDataBucketBranch.h:71