ATLAS Offline Software
TPCnvElt.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
14 #include "StorageSvc/DbReflex.h"
15 
17 #include "GaudiKernel/MsgStream.h"
18 #include "GaudiKernel/System.h"
19 
20 
21 namespace AthenaPoolCnvSvc {
22 
23 
30 Guid guidFromTypeinfo (const std::type_info& ti)
31 {
33  if (!typ) {
34  // Print additional diagnostic information here to try to get a better
35  // handle on why this is happening.
36  // See ATEAM-697.
37  std::string clname = System::typeinfoName (ti);
38  MsgStream msg (Athena::getMessageSvc(), "TPCnvElt");
39  msg << MSG::ERROR << "Cannot find full dictionary information for class " <<
40  clname << endmsg;
41  TClass* cls = static_cast<TClass*>(typ);
42  if (!cls) {
43  msg << MSG::ERROR << "No TClass; trying to retrieve again." << endmsg;
44  cls = TClass::GetClass (ti);
45  if (!cls) {
46  msg << MSG::ERROR << "Couldn't retrieve via type_info; try by name." << endmsg;
47  cls = TClass::GetClass (clname.c_str());
48  }
49  }
50  if (cls) {
51  msg << MSG::ERROR << "Got TClass " << cls->GetName() << " " <<
52  cls->HasInterpreterInfoInMemory() << " " <<
53  cls->HasInterpreterInfo() << " " <<
54  cls->GetState() << " " <<
55  cls->HasDictionary() << " " <<
56  cls->IsLoaded() << " " <<
57  cls->IsForeign() << endmsg;
58 
59  TClass* cls2 = TClass::GetClass (ti);
60  if (cls2) {
61  msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " <<
62  (cls == cls2) << " " <<
63  cls2->HasInterpreterInfoInMemory() << " " <<
64  cls2->HasInterpreterInfo() << " " <<
65  cls2->GetState() << " " <<
66  cls2->HasDictionary() << " " <<
67  cls2->IsLoaded() << " " <<
68  cls2->IsForeign() << endmsg;
69  }
70  else {
71  msg << MSG::ERROR << "Could not re-get class by ti" << endmsg;
72  }
73 
74  cls2 = TClass::GetClass (clname.c_str());
75  if (cls2) {
76  msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " <<
77  (cls == cls2) << " " <<
78  cls2->HasInterpreterInfoInMemory() << " " <<
79  cls2->HasInterpreterInfo() << " " <<
80  cls2->GetState() << " " <<
81  cls2->HasDictionary() << " " <<
82  cls2->IsLoaded() << " " <<
83  cls2->IsForeign() << endmsg;
84  }
85  else {
86  msg << MSG::ERROR << "Could not re-get class by name" << endmsg;
87  }
88 
89  sleep (10);
90 
91  cls2 = TClass::GetClass (ti);
92  if (cls2) {
93  msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " <<
94  (cls == cls2) << " " <<
95  cls2->HasInterpreterInfoInMemory() << " " <<
96  cls2->HasInterpreterInfo() << " " <<
97  cls2->GetState() << " " <<
98  cls2->HasDictionary() << " " <<
99  cls2->IsLoaded() << " " <<
100  cls2->IsForeign() << endmsg;
101  }
102  else {
103  msg << MSG::ERROR << "Could not re-get class by ti" << endmsg;
104  }
105 
106  cls2 = TClass::GetClass (clname.c_str());
107  if (cls2) {
108  msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " <<
109  (cls == cls2) << " " <<
110  cls2->HasInterpreterInfoInMemory() << " " <<
111  cls2->HasInterpreterInfo() << " " <<
112  cls2->GetState() << " " <<
113  cls2->HasDictionary() << " " <<
114  cls2->IsLoaded() << " " <<
115  cls2->IsForeign() << endmsg;
116  }
117  else {
118  msg << MSG::ERROR << "Could not re-get class by name" << endmsg;
119  }
120  }
122  }
123  return pool::DbReflex::guid (typ);
124 }
125 
126 
127 } // namespace AthenaPoolCnvSvc
DbReflex.h
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
pool::DbReflex::forTypeInfo
static const TypeH forTypeInfo(const std::type_info &info)
Access classes by RTTI type information.
AthenaPoolCnvSvc::throwExcNoDictForClass
void throwExcNoDictForClass(const std::type_info &ti)
Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.
Definition: Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:47
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition: Guid.h:20
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TPCnvElt.h
Helper for calling a TP converter from an Athena converter.
exceptions.h
Exceptions that can be thrown from AthenaPoolCnvSvc.
AthenaPoolCnvSvc::guidFromTypeinfo
Guid guidFromTypeinfo(const std::type_info &ti)
Given a type_info, get the corresponding pool guid.
Definition: TPCnvElt.cxx:30
TScopeAdapter
Definition: RootType.h:119
pool::DbReflex::guid
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.
AthenaPoolCnvSvc
Definition: Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/debug.h:26