Root streamer that calls our converter when reading in non-split mode.
More...
#include <TConverterStreamer.h>
|
| void | FindVersion (TBuffer &buf, UInt_t &startpos, UInt_t &bcnt, Version_t &version) |
| | Read the initial byte count/version from an object.
|
| Version_t | R__FindStreamerInfoVersion (const TClass *cl, UInt_t checksum) |
| | Translate a Root checksum to a class version number.
|
|
| const CheckSumMap & | fConvmap |
| | The checksum -> converter map passed to the constructor.
|
| TClass * | fClass |
| | The transient class we're reading.
|
| UInt_t | fStreamerChecksum |
| | Cached checksum for the last object read.
|
| TFile * | fLastFile |
| | Cached file for the last object read.
|
Root streamer that calls our converter when reading in non-split mode.
Definition at line 44 of file TConverterStreamer.h.
◆ CheckSumMap
◆ Payload
◆ TConverterStreamer()
| TConverterStreamer::TConverterStreamer |
( |
const CheckSumMap & | convmap, |
|
|
TClass * | cls ) |
Constructor.
- Parameters
-
| convmap | Map from checksums to converter instances. |
| cls | The transient class that we're reading. |
Definition at line 24 of file TConverterStreamer.cxx.
30{
31}
const CheckSumMap & fConvmap
The checksum -> converter map passed to the constructor.
UInt_t fStreamerChecksum
Cached checksum for the last object read.
TFile * fLastFile
Cached file for the last object read.
TClass * fClass
The transient class we're reading.
◆ FindVersion()
| void TConverterStreamer::FindVersion |
( |
TBuffer & | buf, |
|
|
UInt_t & | startpos, |
|
|
UInt_t & | bcnt, |
|
|
Version_t & | version ) |
|
private |
Read the initial byte count/version from an object.
- Parameters
-
| buf | The Root I/O buffer. |
| [out] | startpos | The starting position of the object. |
| [out] | bcnt | The length of the object, in bytes. |
| [out] | version | The version of the object being read. |
As a side effect, this sets fStreamerChecksum.
Definition at line 75 of file TConverterStreamer.cxx.
79{
80 const UInt_t kByteCountMask = 0x40000000;
81
82
83 startpos =
buf.Length();
84
85
86
87
88
89 union {
91 Version_t vers[2];
93#ifdef R__BYTESWAP
94
97#else
98
101#endif
102 if (!(
v.cnt & kByteCountMask)) {
103
104 buf.SetBufferOffset(
buf.Length() -
sizeof(UInt_t));
106 }
107 bcnt = (
v.cnt & ~kByteCountMask);
109
112
114 }
116 if (version <= 0) {
120 } else if (version == 1) {
121
122
124
125 }
126 else if (parent &&
parent->GetVersion() < 40000)
127 {
128
129
131 fClass->GetStreamerInfos()->GetLast() > 1)
132 {
133 const TList*
list =
parent->GetStreamerInfoList();
134 const TStreamerInfo*
local = (TStreamerInfo*)
list->FindObject(
fClass->GetName());
135 if (local) {
139 }
140 else {
142 }
143 }
144 }
145 }
146 }
148}
Version_t R__FindStreamerInfoVersion(const TClass *cl, UInt_t checksum)
Translate a Root checksum to a class version number.
◆ operator()()
| void TConverterStreamer::operator() |
( |
TBuffer & | b, |
|
|
void * | obj ) |
|
virtual |
Standard Root streamer interface.
- Parameters
-
| b | Buffer for Root I/O. |
| obj | Object being read or written. |
Definition at line 39 of file TConverterStreamer.cxx.
40{
42
43 UInt_t startpos, bcnt;
46
47
49
51
52 i->second.first->ReadBuffer (b, obj, version, startpos, bcnt);
53 }
54 else {
55
56 fClass->ReadBuffer(b, obj, version, startpos, bcnt);
57 }
58 }
59 else {
60
61 fClass->WriteBuffer(b, obj);
62 }
63}
void FindVersion(TBuffer &buf, UInt_t &startpos, UInt_t &bcnt, Version_t &version)
Read the initial byte count/version from an object.
◆ R__FindStreamerInfoVersion()
| Version_t TConverterStreamer::R__FindStreamerInfoVersion |
( |
const TClass * | cl, |
|
|
UInt_t | checksum ) |
|
private |
Translate a Root checksum to a class version number.
- Parameters
-
| cl | The class being examined. |
| checksum | The checksum to translate. |
- Returns
- The class version number of
cl with checksum checksum, or 0 if there's no match.
Definition at line 158 of file TConverterStreamer.cxx.
160{
161
162
163
164
165
167 Int_t ninfos =
cl->GetStreamerInfos()->GetEntriesFast();
168 for (Int_t i = 1;
i < ninfos;
i++) {
169
170
171 TStreamerInfo*
info = (TStreamerInfo*)
cl->GetStreamerInfos()->At(i);
172 if (!info) {
173 continue;
174 }
175 if (
info->GetCheckSum() == checksum) {
177 break;
178 }
179 }
180 return(version);
181}
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
◆ fClass
| TClass* TConverterStreamer::fClass |
|
private |
◆ fConvmap
◆ fLastFile
| TFile* TConverterStreamer::fLastFile |
|
private |
◆ fStreamerChecksum
| UInt_t TConverterStreamer::fStreamerChecksum |
|
private |
The documentation for this class was generated from the following files: