Go to the documentation of this file.
4 #ifndef tools_rroot_branch
5 #define tools_rroot_branch
27 static const std::string s_v(
"tools::rroot::branch");
31 virtual void*
cast(
const std::string& a_class)
const {
32 if(
void* p = cmp_cast<branch>(
this,a_class))
return p;
39 if(
void* p = cmp_cast<branch>(
this,a_class)) {
return p;}
88 if(!a_buffer.
read(fCompress))
return false;
89 if(!a_buffer.
read(fBasketSize))
return false;
91 if(!a_buffer.
read(fMaxBaskets))
return false;
95 if(!a_buffer.
read(v))
return false;
99 if(!a_buffer.
read(v))
return false;
103 if(!a_buffer.
read(v))
return false;
106 if(!a_buffer.
read(fOffset))
return false;
109 if(!a_buffer.
read(fCompress))
return false;
110 if(!a_buffer.
read(fBasketSize))
return false;
114 if(!a_buffer.
read(fOffset))
return false;
115 if(!a_buffer.
read(fMaxBaskets))
return false;
117 if(!a_buffer.
read(v))
return false;
121 if(!a_buffer.
read(v))
return false;
125 if(!a_buffer.
read(v))
return false;
130 if(!a_buffer.
read(fCompress))
return false;
131 if(!a_buffer.
read(fBasketSize))
return false;
135 if(!a_buffer.
read(fOffset))
return false;
136 if(!a_buffer.
read(fMaxBaskets))
return false;
137 if(!a_buffer.
read(fSplitLevel))
return false;
139 if(!a_buffer.
read(v))
return false;
143 if(!a_buffer.
read(v))
return false;
147 if(!a_buffer.
read(v))
return false;
154 if(!a_buffer.
read(fCompress))
return false;
155 if(!a_buffer.
read(fBasketSize))
return false;
159 if(!a_buffer.
read(fOffset))
return false;
160 if(!a_buffer.
read(fMaxBaskets))
return false;
161 if(!a_buffer.
read(fSplitLevel))
return false;
163 if(!a_buffer.
read(v))
return false;
167 if(!a_buffer.
read(v))
return false;
171 if(!a_buffer.
read(v))
return false;
175 }
else if(vers<=10) {
179 if(!a_buffer.
read(fCompress))
return false;
180 if(!a_buffer.
read(fBasketSize))
return false;
184 if(!a_buffer.
read(v))
return false;
186 if(!a_buffer.
read(fOffset))
return false;
187 if(!a_buffer.
read(fMaxBaskets))
return false;
188 if(!a_buffer.
read(fSplitLevel))
return false;
191 if(!a_buffer.
read(v))
return false;
195 if(!a_buffer.
read(v))
return false;
199 if(!a_buffer.
read(v))
return false;
208 if(!a_buffer.
read(fCompress))
return false;
209 if(!a_buffer.
read(fBasketSize))
return false;
213 if(!a_buffer.
read(v))
return false;
217 if(!_dummy.
stream(a_buffer)) {
218 m_out <<
"tools::rroot::branch::stream : can't read (dummy) TIOFeatures." << std::endl;
222 if(!a_buffer.
read(fOffset))
return false;
223 if(!a_buffer.
read(fMaxBaskets))
return false;
224 if(!a_buffer.
read(fSplitLevel))
return false;
226 if(!a_buffer.
read(v))
return false;
230 if(!a_buffer.
read(v))
return false;}
232 if(!a_buffer.
read(v))
return false;
236 if(!a_buffer.
read(v))
return false;
247 m_out <<
"tools::rroot::branch::stream :"
248 <<
" can't read branches."
272 m_out <<
"tools::rroot::branch::stream :"
273 <<
" can't read leaves."
284 m_out <<
"tools::rroot::branch::stream :"
285 <<
" can't read baskets."
294 m_out <<
"tools::rroot::branch::stream :"
295 <<
" fMaxBaskets null."
303 {
for(
uint32 i=0;i<fMaxBaskets;i++) {
329 m_out <<
"tools::rroot::branch::stream :"
330 <<
" v < 2. Not (yet) handled."
336 if(!a_buffer.
read(n)) {
340 for(
int i=0;i<n;i++) {
342 if(!a_buffer.
read(_s)) {
355 if(!a_buffer.
read(isArray)) {
368 if(!a_buffer.
read(isArray)) {
381 if(!a_buffer.
read(isBigFile)) {
391 for(
uint32 i=0;i<fMaxBaskets;i++) {
393 if(!a_buffer.
read(_s)) {
406 if(!a_buffer.
read(isArray)) {
419 if(!a_buffer.
read(isArray)) {
435 if(!a_buffer.
read(isArray)) {
452 std::string fileName;
453 if(!a_buffer.
read(fileName)) {
473 m_first_last.push_back(std::pair<uint64,uint64>(first,last));
478 m_first_last.push_back(std::pair<uint64,uint64>(first,last));
485 for(
uint32 i=0;i<fMaxBaskets;i++) {
488 mxi = mx<uint32>(i,mxi);
492 m_out <<
"tools::rroot::branch::stream :"
493 <<
" fBasketSeek[] inconsistent with m_write_basket."
507 if(!(*it)->buf()||!(*it)->buf_size()) {
508 m_out <<
"tools::rroot::branch::stream :"
509 <<
" expect a basket with a not empty buffer."
514 m_baskets[index] = std::pair<basket*,bool>(*it,
false);
527 if(!(*it)->read_buffer(a_buffer)) {
528 m_out <<
"tools::rroot::branch::read_leaves :"
529 <<
" read_buffer failed."
553 m_out <<
"tools::rroot::branch::find_entry :"
554 <<
" nothing to read."
560 m_out <<
"tools::rroot::branch::find_entry :"
561 <<
" bad m_first_last access."
570 if((a_entry<first)||(a_entry>last)) {
579 if((a_entry>=first)&&(a_entry<=last)) {
586 typedef std::pair<uint64,uint64> first_last;
590 if((a_entry>=first)&&(a_entry<=last)) {
599 m_out <<
"tools::rroot::branch::find_entry :"
600 <<
" fancy fBasketEntry."
606 std::map<uint32, std::pair<basket*,bool> >::iterator it =
m_baskets.find(old_read_basket);
608 if((*it).second.second) {
609 basket* bsk = (*it).second.first;
623 bsk = (*it).second.first;
626 m_out <<
"tools::rroot::branch::find_entry :"
627 <<
" basket lacking !"
634 m_out <<
"tools::rroot::branch::find_entry :"
640 m_out <<
"tools::rroot::branch::find_entry :"
648 m_out <<
"tools::rroot::branch::find_entry :"
675 m_out <<
"tools::rroot::branch::find_entry :"
676 <<
" can't access entry offset " << index
681 bufbegin = entry_offset[index];
689 m_out <<
"tools::rroot::branch::find_entry :"
690 <<
" not null displacement. Not yet handled."
722 m_out <<
"tools::rroot::branch::find_entry :"
723 <<
" can't read leaves for entry " << a_entry
725 <<
", first " << first
734 a_nbytes = _buffer.
length() - bufbegin;
743 if(!
find_entry(a_file,a_entry,n))
return false;
749 num = mn<uint32>(num,10);
757 for(
uint32 i=0;i<num;i++) {
792 mem::increment(
s_class().c_str());
798 mem::decrement(
s_class().c_str());
832 m_out <<
"tools::rroot::branch::get_basket :"
833 <<
" read_file() failed."
839 if(!_basket->
stream(_buffer)) {
840 m_out <<
"tools::rroot::branch::get_basket :"
841 <<
" basket stream failed."
849 m_out <<
"tools::rroot::branch::get_basket :"
850 <<
" get_object_buffer() failed."
857 m_out <<
"tools::rroot::branch::get_basket :"
859 <<
" a_pos " << a_pos
860 <<
" seek_key() " << _basket->
seek_key()
875 m_out <<
"tools::rroot::branch::get_basket :"
876 <<
" read_offset_tables failed."
893 {
typedef std::pair<basket*,bool> basket_todel;
895 if((*it).second.second)
delete (*it).second.first;
905 m_out <<
"tools::rroot::branch::_dump_first_last :"
908 typedef std::pair<uint64,uint64> first_last;
910 uint64 first = (*it).first;
911 uint64 last = (*it).second;
912 m_out <<
"tools::rroot::branch::stream :"
913 <<
" first " << first
#define tools_mforit(a__K, a__V, a__m, a__it)
#define tools_vforcit(a__T, a__v, a__it)