16 #include "TStreamerElement.h"
17 #include "TMemberStreamer.h"
43 std::lock_guard<std::mutex> lock (initmutex);
49 TClass*
cl = gROOT->GetClass (
"TStreamerInfo",
true);
55 TVirtualStreamerInfo::Factory ();
57 ::Error (
"TConvertingStreamerInfo",
58 "Can't find TClass for TStreamerInfo");
95 using namespace std::placeholders;
99 TStreamerInfo::BuildOld();
116 const std::string& from,
117 const std::string&
to)
120 std::lock_guard<std::mutex> lock (
mutex);
122 if (TMemberStreamer*
conv =
126 TStreamerElement* elem = GetStreamerElement (
field.c_str(),
offset);
127 TClass*
cl = gROOT->GetClass (
to.c_str());
129 elem->SetTypeName (
to.c_str());
130 elem->Update (elem->GetClass(),
cl);
131 elem->SetNewType (elem->GetType());
132 elem->SetStreamer (
conv);
152 if (smsg.substr (0, 15) !=
"Cannot convert ")
return false;
154 std::string::size_type ifrom = smsg.find (
" from type:");
155 if (ifrom == std::string::npos)
return false;
157 std::string::size_type ifield = smsg.rfind (
"::", ifrom);
158 if (ifield == std::string::npos)
return false;
160 std::string
field (smsg, ifield+2, ifrom - (ifield+2));
162 std::string::size_type ito = smsg.find (
" to type:");
163 if (ito == std::string::npos)
return false;
166 while (ifrom < ito && smsg[ifrom] ==
' ')
168 std::string from (smsg, ifrom, ito - ifrom);
170 std::string::size_type iskip = smsg.find (
", skip element");
171 if (iskip == std::string::npos)
return false;
174 while (ito < iskip && smsg[ito] ==
' ')
176 std::string
to (smsg, ito, iskip - ito);