ATLAS Offline Software
Loading...
Searching...
No Matches
TPCnvElt.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
10
11
14#include "StorageSvc/DbReflex.h"
15
17#include "GaudiKernel/MsgStream.h"
18#include "GaudiKernel/System.h"
19
20
21namespace AthenaPoolCnvSvc {
22
23
30Guid 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 cls2 = TClass::GetClass (ti);
90 if (cls2) {
91 msg << MSG::ERROR << "Got TClass by ti " << cls2->GetName() << " " <<
92 (cls == cls2) << " " <<
93 cls2->HasInterpreterInfoInMemory() << " " <<
94 cls2->HasInterpreterInfo() << " " <<
95 cls2->GetState() << " " <<
96 cls2->HasDictionary() << " " <<
97 cls2->IsLoaded() << " " <<
98 cls2->IsForeign() << endmsg;
99 }
100 else {
101 msg << MSG::ERROR << "Could not re-get class by ti" << endmsg;
102 }
103
104 cls2 = TClass::GetClass (clname.c_str());
105 if (cls2) {
106 msg << MSG::ERROR << "Got TClass by name " << cls2->GetName() << " " <<
107 (cls == cls2) << " " <<
108 cls2->HasInterpreterInfoInMemory() << " " <<
109 cls2->HasInterpreterInfo() << " " <<
110 cls2->GetState() << " " <<
111 cls2->HasDictionary() << " " <<
112 cls2->IsLoaded() << " " <<
113 cls2->IsForeign() << endmsg;
114 }
115 else {
116 msg << MSG::ERROR << "Could not re-get class by name" << endmsg;
117 }
118 }
120 }
121 return pool::DbReflex::guid (typ);
122}
123
124
125} // namespace AthenaPoolCnvSvc
#define endmsg
Exceptions that can be thrown from AthenaPoolCnvSvc.
Helper for calling a TP converter from an Athena converter.
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition Guid.h:25
static const TypeH forTypeInfo(const std::type_info &info)
Access classes by RTTI type information.
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.
singleton-like access to IMessageSvc via open function and helper
Guid guidFromTypeinfo(const std::type_info &ti)
Given a type_info, get the corresponding pool guid.
Definition TPCnvElt.cxx:30
void throwExcNoDictForClass(const std::type_info &ti)
Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.
IMessageSvc * getMessageSvc(bool quiet=false)
RootType TypeH
Definition DbReflex.h:30
MsgStream & msg
Definition testRead.cxx:32