ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaPOOL
AthenaPoolCnvSvc
src
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
12
#include "
AthenaPoolCnvSvc/TPCnvElt.h
"
13
#include "
AthenaPoolCnvSvc/exceptions.h
"
14
#include "
StorageSvc/DbReflex.h
"
15
16
#include "
AthenaKernel/getMessageSvc.h
"
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
{
32
pool::TypeH
typ =
pool::DbReflex::forTypeInfo
(ti);
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
}
119
throwExcNoDictForClass
(ti);
120
}
121
return
pool::DbReflex::guid
(typ);
122
}
123
124
125
}
// namespace AthenaPoolCnvSvc
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
exceptions.h
Exceptions that can be thrown from AthenaPoolCnvSvc.
DbReflex.h
TPCnvElt.h
Helper for calling a TP converter from an Athena converter.
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
pool::DbReflex::forTypeInfo
static const TypeH forTypeInfo(const std::type_info &info)
Access classes by RTTI type information.
pool::DbReflex::guid
static Guid guid(const TypeH &id)
Determine Guid (normalized string form) from reflection type.
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
AthenaPoolCnvSvc
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/debug.h:26
AthenaPoolCnvSvc::guidFromTypeinfo
Guid guidFromTypeinfo(const std::type_info &ti)
Given a type_info, get the corresponding pool guid.
Definition
TPCnvElt.cxx:30
AthenaPoolCnvSvc::throwExcNoDictForClass
void throwExcNoDictForClass(const std::type_info &ti)
Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:46
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition
getMessageSvc.cxx:20
pool::TypeH
RootType TypeH
Definition
DbReflex.h:30
msg
MsgStream & msg
Definition
testRead.cxx:32
Generated on
for ATLAS Offline Software by
1.17.0