116 const std::string& from,
117 const std::string& to)
119 static std::mutex
mutex;
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);
178 return patch (field, from, to);