19#include "TMemberStreamer.h"
59 TClass* cls = conv->GetTransClass();
68 cmap[conv->GetCheckSum()] = std::make_pair (conv, takeown);
82 TClass* cl = gROOT->GetClass (convname);
83 if (!cl)
return false;
84 TClass* basecl = gROOT->GetClass (
"TVirtualConverter");
85 int offs = cl->GetBaseClassOffset (basecl);
86 if (offs < 0)
return false;
87 char* cnv =
reinterpret_cast<char*
> (cl->New());
103 auto i =
fMap.find (name);
104 if (i !=
fMap.end()) {
105 auto i2 = i->second.find (checksum);
106 if (i2 != i->second.end())
107 return i2->second.first;
114 const std::string& to_type,
115 TMemberStreamer* streamer)
118 std::string key = from_type +
"-" + to_type;
119 auto i =
fSMap.find (key);
120 if (i !=
fSMap.end())
122 fSMap[key] = streamer;
128 const std::string& to_type)
const
131 std::string key = from_type +
"-" + to_type;
132 auto i =
fSMap.find (key);
133 if (i !=
fSMap.end())
158 for (
auto& [name, checksum_map] :
fMap) {
159 for (
auto& [checksum, payload] : checksum_map) {
161 delete payload.first;
165 for (
auto& [key, streamer] :
fSMap)
void TConvertingBranchElement_init()
To allow calling Initialize without having to depend on the header.
Registry for Root converters.
Root streamer that calls our converters when reading in non-split mode.
Base class for Root converters.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
Registry for Root converters.
MapType fMap
Map of registered converters.
TMemberStreamer * GetStreamerConverter(const std::string &from_type, const std::string &to_type) const
std::map< UInt_t, Payload > CheckSumMap
std::lock_guard< std::mutex > lock_t
static TConverterRegistry * Instance()
Return a pointer to the global registry instance.
~TConverterRegistry()
Destructor.
void AddConverter(TVirtualConverter *conv)
Add a new converter to the registry.
std::mutex fMutex
Protect access to the map.
void AddStreamerConverter(const std::string &from_type, const std::string &to_type, TMemberStreamer *streamer)
TVirtualConverter * GetConverter(const char *name, int checksum) const
Look up a converter in the registry by name and checksum.
Root streamer that calls our converter when reading in non-split mode.
Base class for converters for Root schema evolution.