Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -78,7 +78,7 @@ inline bool Axis_read_v7(buffer& a_buffer,axis_t& a_axis) {
|
||||
|
||||
inline unsigned int new_bin_number(const std::vector< axis_t >& aAxes) {
|
||||
unsigned int number = 1;
|
||||
for(unsigned int iaxis=0;iaxis<aAxes.size();iaxis++)
|
||||
for(unsigned int iaxis=0;iaxis<aAxes.size();iaxis++)
|
||||
number *= (aAxes[iaxis].bins()+2);
|
||||
return number;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ inline void add_outflow(const std::vector< axis_t >& aAxes,std::vector<T>& aVect
|
||||
for(int index=0;index<oldn;index++) {
|
||||
// Get new offset of index :
|
||||
offset = index;
|
||||
{for(int iaxis=dim-1;iaxis>=0;iaxis--) {
|
||||
{for(int iaxis=dim-1;iaxis>=0;iaxis--) {
|
||||
is[iaxis] = offset/aAxes[iaxis].m_offset;
|
||||
offset -= is[iaxis] * aAxes[iaxis].m_offset;
|
||||
}}
|
||||
|
||||
@@ -64,19 +64,19 @@ public:
|
||||
bool created;
|
||||
if(!a_buffer.read_object(m_fac,args,obj,created)) {
|
||||
m_out << "tools::rroot::base_leaf::stream :"
|
||||
<< " can't read object."
|
||||
<< " can't read object."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
if(!obj) {
|
||||
//m_out << "tools::rroot::base_leaf::stream :"
|
||||
// << " null leaf count object."
|
||||
// << " null leaf count object."
|
||||
// << std::endl;
|
||||
} else {
|
||||
m_leaf_count = safe_cast<iro,base_leaf>(*obj);
|
||||
if(!m_leaf_count) {
|
||||
m_out << "tools::rroot::base_leaf::stream :"
|
||||
<< " can't cast base_leaf."
|
||||
<< " can't cast base_leaf."
|
||||
<< std::endl;
|
||||
m_leaf_count = 0;
|
||||
if(created) {
|
||||
@@ -151,14 +151,14 @@ public:
|
||||
// Return the number of effective elements of this leaf.
|
||||
if(m_leaf_count) {
|
||||
m_out << "tools::rroot::base_leaf::length :"
|
||||
<< " m_leaf_count not null. Case not yet handled."
|
||||
<< " m_leaf_count not null. Case not yet handled."
|
||||
<< std::endl;
|
||||
return m_length;
|
||||
|
||||
//uint32 len = m_leaf_count->number();
|
||||
//if (len > fLeafCount->maximum()) {
|
||||
// m_out << "tools::rroot::base_leaf::length :"
|
||||
// << fName << ", len=" << len << " and max="
|
||||
// << fName << ", len=" << len << " and max="
|
||||
// << fLeafCount->maximum()
|
||||
// << std::endl;
|
||||
// len = fLeafCount->maximum();
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
(flag!=51)&&(flag!=52) ) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " bad flag " << (int)flag
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -91,16 +91,16 @@ public:
|
||||
//due to the upper "G.Barrand if", flag is here in {1,11,41,51}
|
||||
|
||||
if(!m_nev_buf_size) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " m_nev_buf_size is zero." << std::endl;
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " m_nev_buf_size is zero." << std::endl;
|
||||
return false;
|
||||
}
|
||||
if(m_nev>m_nev_buf_size) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " m_nev>m_nev_buf_size !"
|
||||
<< " m_nev " << m_nev
|
||||
<< " m_nev_buf_size " << m_nev_buf_size
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
m_entry_offset = new int[m_nev_buf_size];
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
if((n!=m_nev)&&(n!=(m_nev+1))) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " m_entry_offset read len mismatch."
|
||||
<< " n " << n
|
||||
<< " m_nev " << m_nev
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
}
|
||||
/* Due to the upper "G.Barrand if", flag can't be in ]20,40[, then to quiet Coverity we comment the below test.
|
||||
if((20<flag)&&(flag<40)) {
|
||||
for(uint32 i=0;i<m_nev;i++){
|
||||
for(uint32 i=0;i<m_nev;i++){
|
||||
m_entry_offset[i] &= ~kDisplacementMask();
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
if((n!=m_nev)&&(n!=(m_nev+1))) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " m_displacement read len mismatch."
|
||||
<< " n " << n
|
||||
<< " m_nev " << m_nev
|
||||
@@ -148,28 +148,28 @@ public:
|
||||
//m_nev_buf_size is the size in bytes of one entry.
|
||||
}
|
||||
if((flag==1)||(flag>10)) {
|
||||
delete [] m_buffer;
|
||||
delete [] m_buffer;
|
||||
m_buffer = 0;
|
||||
m_buf_size = 0;
|
||||
if(fBufferSize) {
|
||||
char* _buf = new char[fBufferSize];
|
||||
if(!_buf) {
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " can't alloc " << fBufferSize << std::endl;
|
||||
m_out << "tools::rroot::basket::stream :"
|
||||
<< " can't alloc " << fBufferSize << std::endl;
|
||||
_clear();
|
||||
return false;
|
||||
}
|
||||
if(v>1) {
|
||||
if(!a_buffer.read_fast_array(_buf,m_last)) {
|
||||
_clear();
|
||||
delete [] _buf;
|
||||
delete [] _buf;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
uint32 n;
|
||||
if(!a_buffer.read_array<char>(fBufferSize,_buf,n)) {
|
||||
_clear();
|
||||
delete [] _buf;
|
||||
delete [] _buf;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
m_entry_offset = new int[a_from.m_nev];
|
||||
if(!m_entry_offset) {
|
||||
m_out << "tools::rroot::basket::basket(cpcstor) :"
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
uint32 len = a_from.m_nev*sizeof(int);
|
||||
@@ -241,13 +241,13 @@ public:
|
||||
m_displacement = new int[a_from.m_nev];
|
||||
if(!m_displacement) {
|
||||
m_out << "tools::rroot::basket::basket(cpcstor) :"
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
uint32 len = a_from.m_nev*sizeof(int);
|
||||
::memcpy(m_displacement,a_from.m_displacement,len);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
basket& operator=(const basket& a_from){
|
||||
parent::operator=(a_from);
|
||||
@@ -267,7 +267,7 @@ public:
|
||||
m_entry_offset = new int[a_from.m_nev];
|
||||
if(!m_entry_offset) {
|
||||
m_out << "tools::rroot::basket::operator=() :"
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
uint32 len = a_from.m_nev*sizeof(int);
|
||||
@@ -278,13 +278,13 @@ public:
|
||||
m_displacement = new int[a_from.m_nev];
|
||||
if(!m_displacement) {
|
||||
m_out << "tools::rroot::basket::operator=() :"
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< " can't alloc " << a_from.m_nev << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
uint32 len = a_from.m_nev*sizeof(int);
|
||||
::memcpy(m_displacement,a_from.m_displacement,len);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -296,13 +296,13 @@ public:
|
||||
uint32 last() const {return m_last;}
|
||||
|
||||
bool read_offset_tables(bool a_byte_swap) {
|
||||
if(!m_buffer) return false;
|
||||
if(!m_last) return false;
|
||||
if(!m_buffer) return false;
|
||||
if(!m_last) return false;
|
||||
|
||||
delete [] m_entry_offset;
|
||||
m_entry_offset = 0;
|
||||
|
||||
buffer _buffer(m_out,a_byte_swap,m_buf_size,m_buffer,0,false);
|
||||
buffer _buffer(m_out,a_byte_swap,m_buf_size,m_buffer,0,false);
|
||||
_buffer.set_offset(m_last);
|
||||
|
||||
{uint32 n;
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
uint32 m_bits;
|
||||
if(!Object_stream(a_buffer,id,m_bits)) return false;
|
||||
a_buffer.set_offset(old);}
|
||||
|
||||
|
||||
if(!Named_stream(a_buffer,m_name,m_title)) return false;
|
||||
|
||||
//::printf("debug : branch::stream %s %s\n",m_name.c_str(),m_title.c_str());
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
return false;
|
||||
}}
|
||||
//::printf("debug : branch::stream : streamed_baskets : end\n");
|
||||
|
||||
|
||||
//fNleaves = m_leaves.size();
|
||||
|
||||
if(fMaxBaskets<=0) {
|
||||
@@ -296,7 +296,7 @@ public:
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
fBasketEntry = new int[fMaxBaskets];
|
||||
fBasketBytes = new int[fMaxBaskets];
|
||||
fBasketSeek = new seek[fMaxBaskets];
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
delete [] v;
|
||||
}}
|
||||
}
|
||||
|
||||
|
||||
if(vers>2) {
|
||||
//TString
|
||||
std::string fileName;
|
||||
@@ -485,7 +485,7 @@ public:
|
||||
for(uint32 i=0;i<fMaxBaskets;i++) {
|
||||
if(!fBasketSeek[i]) continue;
|
||||
num++;
|
||||
mxi = mx<uint32>(i,mxi);
|
||||
mxi = mx<uint32>(i,mxi);
|
||||
}
|
||||
if(m_write_basket) {
|
||||
if((num!=m_write_basket)||(mxi!=(m_write_basket-1))) {
|
||||
@@ -512,10 +512,10 @@ public:
|
||||
}
|
||||
//in the below, false is to say m_baskets is not owner of *it.
|
||||
m_baskets[index] = std::pair<basket*,bool>(*it,false);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -525,7 +525,7 @@ public:
|
||||
virtual bool read_leaves(ifile&,buffer& a_buffer){
|
||||
tools_vforcit(base_leaf*,m_leaves,it) {
|
||||
if(!(*it)->read_buffer(a_buffer)) {
|
||||
m_out << "tools::rroot::branch::read_leaves :"
|
||||
m_out << "tools::rroot::branch::read_leaves :"
|
||||
<< " read_buffer failed."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -579,7 +579,7 @@ public:
|
||||
if((a_entry>=first)&&(a_entry<=last)) {
|
||||
m_read_basket++;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!found) {
|
||||
uint32 count = 0;
|
||||
@@ -591,7 +591,7 @@ public:
|
||||
m_read_basket = count;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@@ -666,7 +666,7 @@ public:
|
||||
|
||||
// Set entry offset in buffer and read data from all leaves
|
||||
//buf->resetMap();
|
||||
|
||||
|
||||
uint32 bufbegin;
|
||||
{int* entry_offset = m__read_basket->entry_offset();
|
||||
if(entry_offset) {
|
||||
@@ -706,7 +706,7 @@ public:
|
||||
if(entry_offset) {
|
||||
uint32 nev = m__read_basket->nev();
|
||||
::printf("debug : eoff : num %d\n",nev);
|
||||
for(uint32 i=0;i<nev;i++){
|
||||
for(uint32 i=0;i<nev;i++){
|
||||
::printf("debug : eoff %d : %d\n",i,entry_offset[i]);
|
||||
}
|
||||
}}
|
||||
@@ -714,7 +714,7 @@ public:
|
||||
}
|
||||
*/
|
||||
|
||||
buffer _buffer(m_out,a_file.byte_swap(),m__read_basket->buf_size(),m__read_basket->buf(),0,false);
|
||||
buffer _buffer(m_out,a_file.byte_swap(),m__read_basket->buf_size(),m__read_basket->buf(),0,false);
|
||||
_buffer.set_offset(bufbegin);
|
||||
_buffer.set_map_objs(true); //for MEMPHYS/applications/read.icc
|
||||
|
||||
@@ -825,28 +825,28 @@ public:
|
||||
protected:
|
||||
basket* get_basket(ifile& a_file,seek a_pos,uint32 a_len) {
|
||||
//if(fBranch.tree().memoryFull(fBufferSize)) fBranch.dropBaskets();
|
||||
if(!a_len) return 0;
|
||||
if(!a_len) return 0;
|
||||
|
||||
basket* _basket = new basket(m_out,a_pos,a_len); //basket is a key.
|
||||
if(!_basket->read_file(a_file)) {
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
<< " read_file() failed."
|
||||
<< std::endl;
|
||||
delete _basket;
|
||||
return 0;
|
||||
}
|
||||
{buffer _buffer(m_out,a_file.byte_swap(),a_len,_basket->buf(),0,false);
|
||||
{buffer _buffer(m_out,a_file.byte_swap(),a_len,_basket->buf(),0,false);
|
||||
if(!_basket->stream(_buffer)) {
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
<< " basket stream failed."
|
||||
<< std::endl;
|
||||
delete _basket;
|
||||
return 0;
|
||||
}}
|
||||
unsigned int sz;
|
||||
unsigned int sz;
|
||||
char* buf = _basket->get_object_buffer(a_file,sz); //basket owns buf.
|
||||
if(!buf) {
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
<< " get_object_buffer() failed."
|
||||
<< std::endl;
|
||||
delete _basket;
|
||||
@@ -854,7 +854,7 @@ protected:
|
||||
}
|
||||
|
||||
if(_basket->seek_key()!=a_pos) { //consistency check.
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
<< " seek anomaly."
|
||||
<< " a_pos " << a_pos
|
||||
<< " seek_key() " << _basket->seek_key()
|
||||
@@ -863,7 +863,7 @@ protected:
|
||||
return 0;
|
||||
}
|
||||
//if(_basket->nbytes()!=a_len) { //consistency check.
|
||||
// m_out << "tools::rroot::branch::get_basket :"
|
||||
// m_out << "tools::rroot::branch::get_basket :"
|
||||
// << " WARNING : length anomaly."
|
||||
// << " a_len " << a_len
|
||||
// << " nbytes() " << _basket->nbytes()
|
||||
@@ -872,7 +872,7 @@ protected:
|
||||
|
||||
if(fEntryOffsetLen) {
|
||||
if(!_basket->read_offset_tables(a_file.byte_swap())) {
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
m_out << "tools::rroot::branch::get_basket :"
|
||||
<< " read_offset_tables failed."
|
||||
<< std::endl;
|
||||
delete _basket;
|
||||
@@ -942,7 +942,7 @@ protected:
|
||||
uint32 m_write_basket; // Last basket number written
|
||||
uint32 m_entry_number; // Current entry number (last one filled in this branch)
|
||||
uint32 m_read_basket; //! Current basket number when reading
|
||||
int* fBasketBytes; //[fMaxBaskets] Lenght of baskets on file
|
||||
int* fBasketBytes; //[fMaxBaskets] Length of baskets on file
|
||||
int* fBasketEntry; //[fMaxBaskets] Table of first entry in eack basket
|
||||
seek* fBasketSeek; //[fMaxBaskets] Addresses of baskets on file
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
_clear();
|
||||
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
@@ -138,7 +138,7 @@ public: //branch
|
||||
}*/
|
||||
//::printf("debug : uuuu : ndata %d\n",n);
|
||||
fNdata = n;
|
||||
|
||||
|
||||
//TClonesArray *clones = (TClonesArray*)fObject;
|
||||
//if (!clones) return;
|
||||
//if (clones->IsZombie()) return;
|
||||
@@ -149,12 +149,12 @@ public: //branch
|
||||
// << " name " << m_name << " ref_cls " << fClassName
|
||||
// << " : type " << fType << ", fNdata " << n
|
||||
// << std::endl;
|
||||
return true;
|
||||
|
||||
return true;
|
||||
|
||||
} else if(fType==31) { // TClonesArray sub-branch (contains the elements).
|
||||
if(fStreamerType==kObject) { //to read EsbRoot fgd_dig.root.
|
||||
int ndata = fBranchCount->get_ndata();
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
::printf("debug : %s : fClassName %s : fID %d : kObject : ndata %d\n",m_name.c_str(),fClassName.c_str(),fID,ndata);
|
||||
#endif
|
||||
streamer_info* _info = a_file.find_streamer_info(fClassName);
|
||||
@@ -162,14 +162,14 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kObject) : streamer_infos for ref_cls " << fClassName << " not found."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
streamer_element* _element = _info->find_streamer_element(fID);
|
||||
if(!_element) {
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kObject) : for ref_cls " << fClassName << ", fID " << fID << " streamer element not found."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
//::printf("debug : element type name %s\n",_element->type_name().c_str());
|
||||
|
||||
@@ -183,12 +183,12 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kObject) : m_obj is not an obj_list."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_list->safe_clear();
|
||||
|
||||
|
||||
for(int index=0;index<ndata;index++) {
|
||||
ifac::args args;
|
||||
iro* _obj = m_fac.create(_element->type_name(),args);
|
||||
@@ -202,14 +202,14 @@ public: //branch
|
||||
}
|
||||
_list->add_object(_obj); //give ownership.
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
if(fStreamerType==kObjectP) return true;
|
||||
//from v4-00-01
|
||||
if(fStreamerType==kDouble32) {
|
||||
int ndata = fBranchCount->get_ndata();
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
::printf("debug : %s : fID %d : double32 : ndata %d\n",m_name.c_str(),fID,ndata);
|
||||
#endif
|
||||
stl_vector<double>* vec = 0;
|
||||
@@ -222,10 +222,10 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kDouble32) : m_obj is not a stl_vector<double>."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
vec->resize(ndata);
|
||||
float afloat;
|
||||
for(int ii=0;ii<ndata;ii++) {
|
||||
@@ -239,12 +239,12 @@ public: //branch
|
||||
//::printf("debug : zzzz %g\n",afloat);
|
||||
(*vec)[ii] = afloat;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
} else if(fStreamerType==kDouble) {
|
||||
int ndata = fBranchCount->get_ndata();
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
::printf("debug : %s : fID %d : double : ndata %d\n",m_name.c_str(),fID,ndata);
|
||||
#endif
|
||||
stl_vector<double>* vec = 0;
|
||||
@@ -257,10 +257,10 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kDouble) : m_obj is not a stl_vector<double>."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
vec->resize(ndata);
|
||||
double* _value = vec_data(*vec);
|
||||
if(!a_buffer.read_fast_array(_value,ndata)) {
|
||||
@@ -270,12 +270,12 @@ public: //branch
|
||||
vec->clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
} else if(fStreamerType==kInt) {
|
||||
int ndata = fBranchCount->get_ndata();
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
::printf("debug : %s : fID %d : int : ndata %d\n",m_name.c_str(),fID,ndata);
|
||||
#endif
|
||||
stl_vector<int>* vec = 0;
|
||||
@@ -288,7 +288,7 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kInt) : m_obj is not a stl_vector<int>."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,15 +301,15 @@ public: //branch
|
||||
vec->clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
} else if((fStreamerType==kUInt)||(fStreamerType==kBits)) {
|
||||
int ndata = fBranchCount->get_ndata();
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
if(fStreamerType==kUInt) ::printf("debug : %s : fID %d : uint : ndata %d\n",m_name.c_str(),fID,ndata);
|
||||
else ::printf("debug : %s : fID %d : bits : ndata %d\n",m_name.c_str(),fID,ndata);
|
||||
#endif
|
||||
#endif
|
||||
stl_vector<uint32>* vec = 0;
|
||||
if(!m_obj) {
|
||||
vec = new stl_vector<uint32>;
|
||||
@@ -320,7 +320,7 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves : " << sout(m_name) << " :"
|
||||
<< " read(kUInt) : m_obj is not a stl_vector<uint32>."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,16 +333,16 @@ public: //branch
|
||||
vec->clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
} else {
|
||||
m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
<< " name " << m_name << " ref_cls " << fClassName
|
||||
<< " : for type " << fType << ", stream_type " << fStreamerType << " not treated."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*
|
||||
//m_obj = clones_array<float>(m_fac,true,false); //true = owner of objects.
|
||||
uint32 ndata = 1;
|
||||
@@ -364,7 +364,7 @@ public: //branch
|
||||
// << std::endl;
|
||||
// return true;
|
||||
//
|
||||
|
||||
|
||||
if((fID==-1)||
|
||||
(fID==1) // for pmx to read LHCb files :
|
||||
){
|
||||
@@ -377,7 +377,7 @@ public: //branch
|
||||
} else {
|
||||
fNdata = 1;
|
||||
}
|
||||
|
||||
|
||||
// read object :
|
||||
bool created = false;
|
||||
if(!m_obj) {
|
||||
@@ -405,14 +405,14 @@ public: //branch
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
<< " name " << m_name << " ref_cls " << fClassName
|
||||
<< " : type " << fType << " not treated, stream_type is " << fStreamerType << "."
|
||||
<< std::endl;
|
||||
return false;
|
||||
return false;
|
||||
|
||||
/*
|
||||
///////////////////////////////////////////////////////
|
||||
@@ -428,7 +428,7 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
<< " name " << m_name << " ref_cls " << fClassName
|
||||
<< " : type " << fType << " not treated."
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
return false;
|
||||
|
||||
} else if(fType==41) {
|
||||
@@ -509,7 +509,7 @@ public: //branch
|
||||
m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
<< " name " << m_name << " ref_cls " << fClassName << " :"
|
||||
<< " obj stream failed."
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
if(created) {delete m_obj;m_obj = 0;}
|
||||
return false;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ public: //branch
|
||||
//m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
// << " name " << m_name << " ref_cls " << fClassName << " :"
|
||||
// << " obj streamed."
|
||||
// << std::endl;
|
||||
// << std::endl;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -549,7 +549,7 @@ public: //branch
|
||||
// m_out << "tools::rroot::branch_element::read_leaves :"
|
||||
// << " name " << m_name << " ref_cls " << fClassName << " :"
|
||||
// << " obj stream failed."
|
||||
// << std::endl;
|
||||
// << std::endl;
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
@@ -597,7 +597,7 @@ public: //branch
|
||||
uint32 n;
|
||||
if(!(*it)->find_entry(a_file,a_entry,n)) return false;
|
||||
a_nbytes += n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -677,7 +677,7 @@ public:
|
||||
}
|
||||
return od; //WARNING : we are not owner.
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
stl_vector<T>* find_entry_vec(ifile& a_file,uint64 a_event) {
|
||||
unsigned int n;
|
||||
@@ -698,7 +698,7 @@ public:
|
||||
}
|
||||
return od; //WARNING : we are not owner.
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void _clear() {
|
||||
if(fBranchCount_created) {delete fBranchCount;fBranchCount = 0;fBranchCount_created = false;}
|
||||
@@ -721,8 +721,8 @@ protected:
|
||||
|
||||
}}
|
||||
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#undef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#undef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -751,7 +751,7 @@ protected:
|
||||
} break;}
|
||||
*/
|
||||
/* 6.12.06 version 10 : fStreamerType : from meta/inc/TVirtualStreamerInfo.h :
|
||||
|
||||
|
||||
enum EReadWrite {
|
||||
kBase = 0, kOffsetL = 20, kOffsetP = 40, kCounter = 6, kCharStar = 7,
|
||||
kChar = 1, kShort = 2, kInt = 3, kLong = 4, kFloat = 5,
|
||||
|
||||
@@ -175,9 +175,9 @@ protected:
|
||||
|
||||
std::ios::fmtflags old_flags = m_out.flags();
|
||||
m_out << "tools::rroot::read_class_tag :"
|
||||
<< " tag unknown case ! "
|
||||
<< " tag unknown case ! "
|
||||
<< tag << " hex " << std::hex << tag
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
m_out.flags(old_flags);
|
||||
|
||||
return false;
|
||||
@@ -221,7 +221,7 @@ protected:
|
||||
// if(!write((clIdx | Rio_kClassMask))) return false;
|
||||
// or
|
||||
// if(!write(Rio_kNewClassTag)) return false;
|
||||
// + write object
|
||||
// + write object
|
||||
// + set byte cnt (cnt|kByteCountMask()) at skipped int.
|
||||
|
||||
if(m_verbose) {
|
||||
@@ -254,7 +254,7 @@ protected:
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
} else {
|
||||
if(m_verbose) {
|
||||
std::ios::fmtflags old_flags = m_out.flags();
|
||||
@@ -269,9 +269,9 @@ protected:
|
||||
a_class.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public:
|
||||
void remove_in_map(iro* a_obj) {
|
||||
#ifdef TOOLS_RROOT_OBJ_MAP_HASH_TABLE
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
<< " class " << sout(sclass) << ", is_ref but map objs is not enabled on this buffer."
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
|
||||
if(m_map_objs) {
|
||||
#ifdef TOOLS_RROOT_OBJ_MAP_HASH_TABLE
|
||||
if(m_objs.find(obj_offset,a_obj)) {
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
<< " is_ref : streamed failed for class " << sout(scls)
|
||||
<< std::endl;
|
||||
//restore a good buffer position :
|
||||
//m_pos = m_buffer+startpos+sizeof(unsigned int);
|
||||
//m_pos = m_buffer+startpos+sizeof(unsigned int);
|
||||
delete obj;
|
||||
return false;
|
||||
}
|
||||
@@ -409,8 +409,8 @@ public:
|
||||
|
||||
// in principle at this point m_pos should be
|
||||
// m_buffer+startpos+sizeof(unsigned int)
|
||||
// but enforce it anyway :
|
||||
m_pos = m_buffer+startpos+sizeof(unsigned int);
|
||||
// but enforce it anyway :
|
||||
m_pos = m_buffer+startpos+sizeof(unsigned int);
|
||||
//check_byte_count(startpos,0,sclass) would always be ok.
|
||||
|
||||
//a_obj = ???
|
||||
@@ -419,7 +419,7 @@ public:
|
||||
if(sclass.empty()) {
|
||||
//m_out << "debug : tools::rroot::buffer::read_object : found empty class name." << std::endl;
|
||||
|
||||
m_pos = m_buffer+startpos+bcnt+sizeof(unsigned int);
|
||||
m_pos = m_buffer+startpos+bcnt+sizeof(unsigned int);
|
||||
|
||||
} else {
|
||||
//m_out << "debug : tools::rroot::buffer::read_object : not a ref, create object." << std::endl;
|
||||
@@ -433,7 +433,7 @@ public:
|
||||
#else
|
||||
obj_map::const_iterator it = m_objs.find(startpos);
|
||||
if(it!=m_objs.end()) {
|
||||
a_obj = (*it).second;
|
||||
a_obj = (*it).second;
|
||||
::printf("debug : find xxx : %d %lu\n",startpos,a_obj);
|
||||
//stay at current m_pos ?
|
||||
return true;
|
||||
@@ -481,7 +481,7 @@ public:
|
||||
if(!check_byte_count(startpos,bcnt,sclass)) {
|
||||
m_out << "tools::rroot::buffer::read_object :"
|
||||
<< " check_byte_count failed "
|
||||
<< "for object of class "
|
||||
<< "for object of class "
|
||||
<< sout(sclass) << "." << std::endl;
|
||||
delete obj;
|
||||
return false;
|
||||
@@ -507,13 +507,13 @@ public:
|
||||
short version = 0;
|
||||
// not interested in byte count
|
||||
if(!parent::read(version)) return false;
|
||||
|
||||
|
||||
// if this is a byte count, then skip next short and read version
|
||||
if(version & kByteCountVMask()) {
|
||||
if(!parent::read(version)) return false;
|
||||
if(!parent::read(version)) return false;
|
||||
}
|
||||
|
||||
|
||||
a_version = version;
|
||||
return true;
|
||||
}
|
||||
@@ -529,7 +529,7 @@ public:
|
||||
|
||||
// before reading object save start position
|
||||
uint32 startpos = (uint32)(m_pos-m_buffer);
|
||||
|
||||
|
||||
// read byte count (older files don't have byte count)
|
||||
// byte count is packed in two individual shorts, this to be
|
||||
// backward compatible with old files that have at this location
|
||||
@@ -546,7 +546,7 @@ public:
|
||||
if(!parent::read(v.vers[0])) return false;
|
||||
if(!parent::read(v.vers[1])) return false;
|
||||
}
|
||||
|
||||
|
||||
// no bytecount, backup and read version
|
||||
uint32 bcnt = 0;
|
||||
if(v.cnt & kByteCountMask()) {
|
||||
@@ -557,11 +557,11 @@ public:
|
||||
if(!parent::read(version)) return false;
|
||||
//printf("Reading version=%d at pos=%d, bytecount=%d\n",
|
||||
//version,*startpos,*bcnt);
|
||||
|
||||
|
||||
a_version = version;
|
||||
a_start_pos = startpos;
|
||||
a_byte_count = bcnt;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -570,21 +570,21 @@ public:
|
||||
|
||||
size_t len = a_start_pos + a_byte_count + sizeof(unsigned int);
|
||||
|
||||
size_t diff = size_t(m_pos-m_buffer);
|
||||
size_t diff = size_t(m_pos-m_buffer);
|
||||
|
||||
if(diff==len) return true;
|
||||
|
||||
if(diff<len) {
|
||||
m_out << "tools::rroot::buffer::check_byte_count :"
|
||||
<< " object of class " << sout(a_store_cls)
|
||||
<< " read too few bytes ("
|
||||
<< " read too few bytes ("
|
||||
<< long_out(long(len-diff)) << " missing)."
|
||||
<< std::endl;
|
||||
}
|
||||
if(diff>len) {
|
||||
m_out << "tools::rroot::buffer::check_byte_count :"
|
||||
<< " object of class " << sout(a_store_cls)
|
||||
<< " read too many bytes ("
|
||||
<< " read too many bytes ("
|
||||
<< long_out(long(diff-len)) << " in excess)." << std::endl;
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ public:
|
||||
<< " " << sout(a_store_cls)
|
||||
<< " streamer not in sync with data on file, fix streamer."
|
||||
<< std::endl;
|
||||
|
||||
|
||||
m_pos = m_buffer+len;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -11,22 +11,22 @@ namespace rroot {
|
||||
|
||||
inline const std::string& TH1F_cls(){
|
||||
static const std::string s_v("TH1F");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TH1D_cls(){
|
||||
static const std::string s_v("TH1D");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TH2F_cls(){
|
||||
static const std::string s_v("TH2F");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TH2D_cls(){
|
||||
static const std::string s_v("TH2D");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TH3D_cls(){
|
||||
@@ -46,12 +46,12 @@ inline const std::string& TProfile2D_cls(){
|
||||
|
||||
inline const std::string& TDirectory_cls(){
|
||||
static const std::string s_v("TDirectory");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TGeoManager_cls(){
|
||||
static const std::string s_v("TGeoManager");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
inline const std::string& TList_cls(){
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
key* find_key(const std::string& a_name) {
|
||||
if(m_file.verbose()) {
|
||||
m_file.out() << "tools::rroot::directory::find_key :"
|
||||
m_file.out() << "tools::rroot::directory::find_key :"
|
||||
<< " " << sout(a_name) << " ..."
|
||||
<< std::endl;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
key* find_key_from_class(const std::string& a_class) {
|
||||
if(m_file.verbose()) {
|
||||
m_file.out() << "tools::rroot::directory::find_key_from_class :"
|
||||
m_file.out() << "tools::rroot::directory::find_key_from_class :"
|
||||
<< " " << sout(a_class) << " ..."
|
||||
<< std::endl;
|
||||
}
|
||||
@@ -124,19 +124,19 @@ public:
|
||||
{seek32 i;
|
||||
if(!rb.read(i)) return false;
|
||||
m_seek_directory = i;}
|
||||
|
||||
|
||||
{seek32 i;
|
||||
if(!rb.read(i)) return false;
|
||||
m_seek_parent = i;}
|
||||
|
||||
|
||||
{seek32 i;
|
||||
if(!rb.read(i)) return false;
|
||||
m_seek_keys = i;}
|
||||
}
|
||||
if(m_file.verbose()) {
|
||||
m_file.out() << "tools::rroot::key::from_buffer :"
|
||||
<< " nbytes keys : " << m_nbytes_keys
|
||||
<< ", pos keys : " << m_seek_keys
|
||||
<< " nbytes keys : " << m_nbytes_keys
|
||||
<< ", pos keys : " << m_seek_keys
|
||||
<< std::endl;
|
||||
}
|
||||
return true;
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
a_number = 0;
|
||||
|
||||
clear_keys();
|
||||
|
||||
|
||||
key headerkey(m_file.out(),m_seek_keys,m_nbytes_keys);
|
||||
if(!headerkey.read_file(m_file)) return false;
|
||||
char* buffer = headerkey.data_buffer();
|
||||
|
||||
@@ -66,7 +66,7 @@ public: //ifile
|
||||
if (::lseek(m_file, a_offset, whence) < 0) {
|
||||
#endif
|
||||
m_out << "tools::rroot::file::set_pos :"
|
||||
<< " cannot set position " << a_offset
|
||||
<< " cannot set position " << a_offset
|
||||
<< " in file " << sout(m_path) << "."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -80,7 +80,7 @@ public: //ifile
|
||||
typedef int ssize_t;
|
||||
#endif
|
||||
ssize_t siz;
|
||||
while ((siz = ::read(m_file,a_buffer,a_length)) < 0 &&
|
||||
while ((siz = ::read(m_file,a_buffer,a_length)) < 0 &&
|
||||
error_number() == EINTR) reset_error_number();
|
||||
if (siz < 0) {
|
||||
m_out << "tools::rroot::file::read_buffer :"
|
||||
@@ -90,7 +90,7 @@ public: //ifile
|
||||
}
|
||||
if (siz != ssize_t(a_length)) {
|
||||
m_out << "tools::rroot::file::read_buffer :"
|
||||
<< " error reading all requested bytes from file "
|
||||
<< " error reading all requested bytes from file "
|
||||
<< sout(m_path) << ", got " << long_out(siz)
|
||||
<< " of " << a_length
|
||||
<< std::endl;
|
||||
@@ -165,7 +165,7 @@ protected:
|
||||
,m_streamer_infos_key(a_from.m_out)
|
||||
,m_streamer_fac(a_from.m_out)
|
||||
,m_streamer_infos(m_streamer_fac)
|
||||
{
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
@@ -242,12 +242,12 @@ protected:
|
||||
if (fWritable) {
|
||||
if (fSeekFree > fBEGIN) {
|
||||
if(!readFreeSegments()) {
|
||||
m_out << "tools::rroot::file::initialize : Cannot read free segments."
|
||||
m_out << "tools::rroot::file::initialize : Cannot read free segments."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
m_out << "tools::rroot::file::initialize : file \"" << fName
|
||||
m_out << "tools::rroot::file::initialize : file \"" << fName
|
||||
<< "\" probably not closed, cannot read free segments" << std::endl;
|
||||
}
|
||||
}
|
||||
@@ -477,7 +477,7 @@ protected:
|
||||
buffer b(m_out,byte_swap(),sz,buf,k.key_length(),false);
|
||||
return m_streamer_infos.stream(b);
|
||||
}
|
||||
|
||||
|
||||
#if defined(__sun) && !defined(__linux__) && (__SUNPRO_CC > 0x420)
|
||||
int error_number() {return ::errno;}
|
||||
void reset_error_number() {::errno = 0;}
|
||||
|
||||
@@ -200,7 +200,7 @@ public: //iro
|
||||
}
|
||||
public:
|
||||
void out(std::ostream& a_out) const {
|
||||
a_out << "streamer_info for class :"
|
||||
a_out << "streamer_info for class :"
|
||||
<< " " << m_name << ", version=" << m_streamed_class_version
|
||||
<< std::endl;
|
||||
tools_vforcit(streamer_element*,m_elements,it) (*it)->out(a_out);
|
||||
@@ -244,13 +244,13 @@ protected:
|
||||
m_streamed_class_version = a_from.m_streamed_class_version;
|
||||
m_elements = a_from.m_elements;
|
||||
return *this;
|
||||
}
|
||||
}
|
||||
public:
|
||||
const std::string& name() const {return m_name;}
|
||||
streamer_element* find_streamer_element(size_t a_index) const {
|
||||
if(a_index>=m_elements.size()) return 0;
|
||||
return m_elements[a_index];
|
||||
}
|
||||
}
|
||||
protected:
|
||||
ifac& m_fac;
|
||||
protected: //Named
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
namespace tools {
|
||||
namespace rroot {
|
||||
|
||||
class iros : public virtual iro,public std::vector<iro*> {
|
||||
class iros : public virtual iro,protected std::vector<iro*> { //proteced to avoid using std::vector::clear().
|
||||
typedef std::vector<iro*> parent;
|
||||
public:
|
||||
public:
|
||||
static const std::string& s_store_class() {
|
||||
static const std::string s_v("TObjArray");
|
||||
return s_v;
|
||||
@@ -86,7 +86,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
void cleanup() {_clear();}
|
||||
parent::const_iterator begin() const {return parent::begin();}
|
||||
parent::iterator begin() {return parent::begin();}
|
||||
parent::const_iterator end() const {return parent::end();}
|
||||
parent::iterator end() {return parent::end();}
|
||||
parent::size_type size() const {return parent::size();}
|
||||
public:
|
||||
void cleanup() {_clear();} //warning : clear is a function of the parent std::vector.
|
||||
void dump(std::ostream& a_out) {
|
||||
a_out << " iros : size " << size() << std::endl;
|
||||
tools_vforcit(iro*,*this,it) {
|
||||
@@ -155,7 +161,7 @@ protected:
|
||||
bool own = (*itb);
|
||||
parent::erase(it);
|
||||
m_owns.erase(itb);
|
||||
if(own) delete entry;
|
||||
if(own) delete entry;
|
||||
}
|
||||
}
|
||||
protected:
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
m_buffer = new char[a_nbytes];
|
||||
if(!m_buffer) {
|
||||
m_out << "tools::rroot::key::key(cpcstor) :"
|
||||
<< " can't alloc " << a_nbytes << "."
|
||||
<< " can't alloc " << a_nbytes << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
m_buf_size = a_nbytes;
|
||||
@@ -130,7 +130,7 @@ protected:
|
||||
m_buffer = new char[a_from.m_buf_size];
|
||||
if(!m_buffer) {
|
||||
m_out << "tools::rroot::key::key(cpcstor) :"
|
||||
<< " can't alloc " << a_from.m_buf_size << "."
|
||||
<< " can't alloc " << a_from.m_buf_size << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
m_buf_size = a_from.m_buf_size;
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
m_buffer = new char[a_from.m_buf_size];
|
||||
if(!m_buffer) {
|
||||
m_out << "tools::rroot::key::operator=() :"
|
||||
<< " can't alloc " << a_from.m_buf_size << "."
|
||||
<< " can't alloc " << a_from.m_buf_size << "."
|
||||
<< std::endl;
|
||||
} else {
|
||||
m_buf_size = a_from.m_buf_size;
|
||||
@@ -191,7 +191,7 @@ public:
|
||||
m_out << "tools::rroot::key::read_file :"
|
||||
<< " reading " << m_nbytes << " bytes"
|
||||
<< " at position " << m_seek_key
|
||||
<< "."
|
||||
<< "."
|
||||
<< std::endl;
|
||||
}
|
||||
return true;
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
} else {
|
||||
{seek32 i;
|
||||
if(!rb.read(i)) return false;
|
||||
m_seek_key = i;}
|
||||
m_seek_key = i;}
|
||||
{seek32 i;
|
||||
if(!rb.read(i)) return false;
|
||||
m_seek_parent_dir = i;}
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
<< ", object name : " << sout(m_object_name)
|
||||
<< ", object title : " << sout(m_object_title)
|
||||
<< ", object size : " << m_object_size
|
||||
<< "."
|
||||
<< "."
|
||||
<< std::endl;
|
||||
}
|
||||
return true;
|
||||
@@ -266,7 +266,7 @@ public:
|
||||
|
||||
char* get_object_buffer(ifile& a_file,uint32& a_size) {
|
||||
if(!m_key_length) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " WARNING : m_key_length is zero."
|
||||
<< std::endl;
|
||||
//delete [] m_buffer;
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
//return 0;
|
||||
}
|
||||
if(!m_nbytes) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " m_nbytes is zero."
|
||||
<< std::endl;
|
||||
delete [] m_buffer;
|
||||
@@ -286,13 +286,13 @@ public:
|
||||
return 0;
|
||||
}
|
||||
if(!m_object_size) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " WARNING : m_object_size is zero."
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
if(a_file.verbose()) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " m_nbytes : " << m_nbytes
|
||||
<< " m_key_length : " << m_key_length
|
||||
<< " m_object_size : " << m_object_size << "."
|
||||
@@ -304,7 +304,7 @@ public:
|
||||
delete [] m_buffer;
|
||||
m_buf_size = m_key_length+m_object_size;
|
||||
if(m_buf_size<m_nbytes) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " WARNING : m_buf_size<m_nbytes."
|
||||
<< " m_buf_size " << m_buf_size
|
||||
<< " m_nbytes " << m_nbytes
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
}
|
||||
m_buffer = new char[m_buf_size];
|
||||
if(!m_buffer) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " can't alloc " << m_buf_size
|
||||
<< std::endl;
|
||||
m_buffer = 0;
|
||||
@@ -337,7 +337,7 @@ public:
|
||||
uint32 decsiz = m_key_length+m_object_size;
|
||||
char* decbuf = new char[decsiz];
|
||||
if(!decbuf) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " can't alloc " << decsiz
|
||||
<< std::endl;
|
||||
a_size = 0;
|
||||
@@ -389,7 +389,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
if(noutot!=m_object_size) {
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
m_out << "tools::rroot::key::get_object_buffer :"
|
||||
<< " decompression mismatch."
|
||||
<< " noutot " << noutot
|
||||
<< " m_object_size " << m_object_size
|
||||
@@ -413,7 +413,7 @@ public:
|
||||
<< ", name : " << sout(m_object_name)
|
||||
<< ", title : " << sout(m_object_title)
|
||||
<< ", size : " << m_object_size
|
||||
<< "."
|
||||
<< "."
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
@@ -432,13 +432,13 @@ protected:
|
||||
_nbytes += sizeof(seek);
|
||||
_nbytes += sizeof(seek); //18+2*8=34
|
||||
} else {
|
||||
_nbytes += sizeof(seek32);
|
||||
_nbytes += sizeof(seek32);
|
||||
_nbytes += sizeof(seek32); //18+2*4=26
|
||||
}
|
||||
_nbytes += std_string_record_size(m_object_class);
|
||||
_nbytes += std_string_record_size(m_object_name);
|
||||
_nbytes += std_string_record_size(m_object_title);
|
||||
//::printf("debug : record_size %d\n",_nbytes);
|
||||
//::printf("debug : record_size %d\n",_nbytes);
|
||||
return _nbytes;
|
||||
}
|
||||
|
||||
@@ -496,7 +496,7 @@ protected:
|
||||
<< " zlib unziper not found." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
unsigned int irep;
|
||||
char* src = (char*)(a_src + HDRSIZE);
|
||||
if(!func(a_out,
|
||||
@@ -512,7 +512,7 @@ protected:
|
||||
#ifdef TOOLS_USE_CSZ
|
||||
} else if (a_src[0] == 'C' && a_src[1] == 'S') {
|
||||
//compressed with Chernyaev & Smirnov
|
||||
|
||||
|
||||
csz__Init_Inflate(_ibufcnt,a_src + HDRSIZE,a_tgtsize,a_tgt);
|
||||
|
||||
if (csz__Inflate()) {
|
||||
|
||||
@@ -103,28 +103,28 @@ public: //base_leaf
|
||||
<< " Size " << leaf_i->num_elem() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (len > leaf_i->get_max()) { //protection.
|
||||
m_out << "tools::rroot::leaf::read_buffer : warning : " << sout(name())
|
||||
<< ", len = " << len << " > max = "
|
||||
m_out << "tools::rroot::leaf::read_buffer : warning : " << sout(name())
|
||||
<< ", len = " << len << " > max = "
|
||||
<< leaf_i->get_max() << std::endl;
|
||||
len = leaf_i->get_max();
|
||||
}
|
||||
|
||||
|
||||
uint32 ndata = len * m_length;
|
||||
|
||||
|
||||
//if(!ndata) {
|
||||
// delete [] m_value;
|
||||
// m_value = new T[1];
|
||||
// m_size = 0;
|
||||
// return true;
|
||||
//}
|
||||
|
||||
|
||||
if(ndata>m_size) {
|
||||
delete [] m_value;
|
||||
m_value = new T[ndata];
|
||||
}
|
||||
|
||||
|
||||
m_size = ndata;
|
||||
if(!a_buffer.read_fast_array(m_value,ndata)) {
|
||||
m_out << "tools::rroot::leaf::read_buffer : \"" << name() << "\" :"
|
||||
@@ -133,7 +133,7 @@ public: //base_leaf
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
} else {
|
||||
if(m_length) {
|
||||
if(m_length>m_size) {
|
||||
@@ -267,7 +267,7 @@ public: //base_leaf
|
||||
// return false;
|
||||
//}
|
||||
//if(len >= m_length) len = m_length-1;
|
||||
|
||||
|
||||
m_value = new char[len+1];
|
||||
|
||||
if(!a_buffer.read_fast_array(m_value,len)) {
|
||||
@@ -418,15 +418,15 @@ public: //base_leaf
|
||||
if (fVirtual) {
|
||||
unsigned char n;
|
||||
if(!a_buffer.read(n)) {
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " read(unsigned char) failed."
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " read(unsigned char) failed."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
char classname[128];
|
||||
if(!a_buffer.read_fast_array(classname,n+1)) {
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " readFastArray failed."
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " readFastArray failed."
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
@@ -440,8 +440,8 @@ public: //base_leaf
|
||||
//return false;
|
||||
}
|
||||
if(!m_obj->stream(a_buffer)) {
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " object stream failed."
|
||||
m_out << "tools::rroot::leaf_object::read_buffer :"
|
||||
<< " object stream failed."
|
||||
<< " Object store class was " << m_obj->store_class_name() << "."
|
||||
<< std::endl;
|
||||
return false;
|
||||
@@ -470,9 +470,9 @@ protected:
|
||||
leaf_object(const leaf_object& a_from)
|
||||
:iro(a_from),base_leaf(a_from),m_obj(0),fVirtual(true){}
|
||||
leaf_object& operator=(const leaf_object&){return *this;}
|
||||
public:
|
||||
public:
|
||||
void set_object(iobject* a_obj) {m_obj = a_obj;} //do not get ownership.
|
||||
protected:
|
||||
protected:
|
||||
iobject* m_obj;
|
||||
protected:
|
||||
bool fVirtual; // Support for Virtuality
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
// Copyright (C) 2010, Guy Barrand. All rights reserved.
|
||||
// See the file tools.license for terms.
|
||||
|
||||
#ifndef tools_rroot_list
|
||||
#define tools_rroot_list
|
||||
|
||||
#include "object"
|
||||
#include "../vmanip"
|
||||
#include "../scast"
|
||||
#include "cids"
|
||||
|
||||
namespace tools {
|
||||
namespace rroot {
|
||||
|
||||
class obj_list : public virtual iro, public std::vector<iro*> {
|
||||
static const std::string& s_store_class() {
|
||||
static const std::string s_v("TList");
|
||||
return s_v;
|
||||
}
|
||||
public:
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v("tools::rroot::obj_list");
|
||||
return s_v;
|
||||
}
|
||||
public: //iro
|
||||
virtual void* cast(const std::string& a_class) const {
|
||||
if(void* p = cmp_cast<obj_list>(this,a_class)) return p;
|
||||
return 0;
|
||||
}
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
public:
|
||||
static cid id_class() {return obj_list_cid();}
|
||||
virtual void* cast(cid a_class) const {
|
||||
if(void* p = cmp_cast<obj_list>(this,a_class)) {return p;}
|
||||
else return 0;
|
||||
}
|
||||
//virtual void* cast(cid) const {return obj_list_cid();}
|
||||
public:
|
||||
virtual iro* copy() const {return new obj_list(*this);}
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
_clear();
|
||||
|
||||
short v;
|
||||
unsigned int s, c;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
|
||||
//::printf("debug : obj_list::stream : version %d, byte count %d\n",v,c);
|
||||
|
||||
{uint32 id,bits;
|
||||
if(!Object_stream(a_buffer,id,bits)) return false;}
|
||||
|
||||
std::string name;
|
||||
if(!a_buffer.read(name)) return false;
|
||||
int nobjects;
|
||||
if(!a_buffer.read(nobjects)) return false;
|
||||
|
||||
//::printf("debug : obj_list : name \"%s\", nobject %d\n",
|
||||
// name.c_str(),nobjects);
|
||||
|
||||
ifac::args args;
|
||||
for (int i=0;i<nobjects;i++) {
|
||||
//::printf("debug : obj_list : n=%d i=%d ...\n",nobjects,i);
|
||||
|
||||
iro* obj;
|
||||
bool created;
|
||||
if(!a_buffer.read_object(m_fac,args,obj,created)){
|
||||
a_buffer.out() << "tools::rroot::obj_list::stream : can't read object." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned char nch;
|
||||
if(!a_buffer.read(nch)) return false;
|
||||
if(nch) {
|
||||
char readOption[256];
|
||||
if(!a_buffer.read_fast_array(readOption,nch)) return false;
|
||||
readOption[nch] = 0;
|
||||
}
|
||||
if(obj) {
|
||||
if(created) {
|
||||
if(m_owner) {
|
||||
push_back(obj);
|
||||
} else { //who manage this object ?
|
||||
if(m_warn) {
|
||||
a_buffer.out() << "tools::rroot::obj_list::stream :"
|
||||
<< " warning : created object of class " << sout(obj->s_cls()) << " not managed."
|
||||
<< std::endl;
|
||||
}
|
||||
push_back(obj);
|
||||
}
|
||||
} else { //someone else may manage this object.
|
||||
if(m_owner) {
|
||||
a_buffer.out() << "tools::rroot::obj_list::stream : not created object can't be manage here." << std::endl;
|
||||
return false;
|
||||
} else {
|
||||
push_back(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return a_buffer.check_byte_count(s,c,s_store_class());
|
||||
}
|
||||
public:
|
||||
obj_list(ifac& a_fac,bool a_owner,bool a_warn) //a_warn used if a_owner=false.
|
||||
:m_fac(a_fac)
|
||||
,m_owner(a_owner)
|
||||
,m_warn(a_warn)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
virtual ~obj_list(){
|
||||
_clear();
|
||||
#ifdef TOOLS_MEM
|
||||
mem::decrement(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
protected:
|
||||
obj_list(const obj_list& a_from)
|
||||
:iro(a_from)
|
||||
,std::vector<iro*>()
|
||||
,m_fac(a_from.m_fac)
|
||||
,m_owner(a_from.m_owner)
|
||||
,m_warn(a_from.m_warn)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
obj_list& operator=(const obj_list&){return *this;}
|
||||
protected:
|
||||
void _clear() {
|
||||
if(m_owner) {
|
||||
safe_clear<iro>(*this);
|
||||
} else {
|
||||
std::vector<iro*>::clear();
|
||||
}
|
||||
}
|
||||
protected:
|
||||
ifac& m_fac;
|
||||
bool m_owner;
|
||||
bool m_warn;
|
||||
};
|
||||
|
||||
class hash_list : public obj_list {
|
||||
static const std::string& s_store_class() {
|
||||
static const std::string s_v("THashList");
|
||||
return s_v;
|
||||
}
|
||||
public:
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v("tools::rroot::hash_list");
|
||||
return s_v;
|
||||
}
|
||||
public: //iro
|
||||
virtual void* cast(const std::string& a_class) const {
|
||||
if(void* p = cmp_cast<hash_list>(this,a_class)) return p;
|
||||
return obj_list::cast(a_class);
|
||||
}
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
public:
|
||||
static cid id_class() {return hash_list_cid();}
|
||||
virtual void* cast(cid a_class) const {
|
||||
if(void* p = cmp_cast<hash_list>(this,a_class)) {return p;}
|
||||
return obj_list::cast(a_class);
|
||||
}
|
||||
public:
|
||||
virtual bool stream(buffer& a_buffer) {
|
||||
uint32 startpos = a_buffer.length();
|
||||
unsigned int s, c;
|
||||
short v;
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
|
||||
//if(!obj_list::stream(a_buffer)) return false;
|
||||
|
||||
a_buffer.set_offset(startpos+c+sizeof(unsigned int));
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public:
|
||||
hash_list(ifac& a_fac,bool a_owner,bool a_warn) //a_warn used if a_owner=false.
|
||||
:obj_list(a_fac,a_owner,a_warn)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
virtual ~hash_list(){
|
||||
#ifdef TOOLS_MEM
|
||||
mem::decrement(s_class().c_str());
|
||||
#endif
|
||||
}
|
||||
protected:
|
||||
hash_list(const hash_list& a_from):iro(a_from),obj_list(a_from){}
|
||||
hash_list& operator=(const hash_list&){return *this;}
|
||||
};
|
||||
|
||||
inline bool dummy_TList_pointer_stream(buffer& a_buffer,ifac& a_fac,bool a_owner,bool a_warn) {
|
||||
obj_list l(a_fac,a_owner,a_warn);
|
||||
return l.stream(a_buffer);
|
||||
}
|
||||
inline bool dummy_THashList_pointer_stream(buffer& a_buffer,ifac& a_fac,bool a_owner,bool a_warn) {
|
||||
hash_list l(a_fac,a_owner,a_warn);
|
||||
return l.stream(a_buffer);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -43,12 +43,12 @@ public:
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
|
||||
//printf("debug : tools::rroot::matrix::stream : version %d\n",v);
|
||||
|
||||
|
||||
// Version 2 streaming (ROOT/v3-00-6).
|
||||
|
||||
|
||||
{uint32 id,bits;
|
||||
if(!Object_stream(a_buffer,id,bits)) return false;}
|
||||
|
||||
|
||||
int Nrows;
|
||||
if(!a_buffer.read(Nrows)) return false;
|
||||
int Ncols;
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
if(!a_buffer.read(RowLwb)) return false;
|
||||
int ColLwb;
|
||||
if(!a_buffer.read(ColLwb)) return false;
|
||||
|
||||
|
||||
//Real_t* Elements; //[fNelems]
|
||||
if(!dummy_array_stream<float>(a_buffer,Nelems)) return false;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
size_t number = data.size();
|
||||
a_v.resize(number);
|
||||
for(size_t index=0;index<number;index++) {
|
||||
a_v[index] = (data[index]==1?true:false);
|
||||
a_v[index] = (data[index]==1?true:false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
public: //intuple
|
||||
virtual void start() {m_index = -1;}
|
||||
virtual bool next() {
|
||||
virtual bool next() {
|
||||
m_index++;
|
||||
if((uint64)m_index>=m_tree.entries()) return false;
|
||||
return true;
|
||||
@@ -82,8 +82,8 @@ public:
|
||||
:read::icol(a_from)
|
||||
,parent(a_from)
|
||||
,m_file(a_from.m_file)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_index(a_from.m_index)
|
||||
,m_ref(a_from.m_ref)
|
||||
{}
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
if(&a_from==this) return *this;
|
||||
return *this;
|
||||
}
|
||||
protected:
|
||||
protected:
|
||||
//typedef typename LEAF::value_t value_t;
|
||||
bool _fetch_entry() const {
|
||||
unsigned int n;
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
m_value = a_from.m_value;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
public:
|
||||
const T& get_value() const {return m_value;}
|
||||
protected:
|
||||
T m_value;
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
:parent(a_from)
|
||||
,m_file(a_from.m_file)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_index(a_from.m_index)
|
||||
,m_ref(a_from.m_ref)
|
||||
{}
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
if(&a_from==this) return *this;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
public:
|
||||
bool get_entry(std::string& a_v) const {
|
||||
if(!_fetch_entry()) {a_v.clear();return false;}
|
||||
a_v = m_ref;
|
||||
@@ -276,7 +276,7 @@ public:
|
||||
m_sep = a_from.m_sep;
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
public:
|
||||
bool get_entry(std::vector<std::string>& a_v) const {
|
||||
if(!_fetch_entry()) {a_v.clear();return false;}
|
||||
a_v = m_ref;
|
||||
@@ -363,8 +363,8 @@ public:
|
||||
:read::icol(a_from)
|
||||
,parent(a_from)
|
||||
,m_file(a_from.m_file)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_index(a_from.m_index)
|
||||
,m_ref(a_from.m_ref)
|
||||
{}
|
||||
@@ -422,7 +422,7 @@ public:
|
||||
:read::icol(a_from),parent(a_from)
|
||||
,m_file(a_from.m_file)
|
||||
,m_be(a_from.m_be)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_leaf(a_from.m_leaf)
|
||||
,m_index(a_from.m_index)
|
||||
,m_ref(a_from.m_ref)
|
||||
{}
|
||||
@@ -647,7 +647,7 @@ public:
|
||||
m_cols.push_back(col);\
|
||||
}\
|
||||
}
|
||||
|
||||
|
||||
TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<char>",char)
|
||||
else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<short>",short)
|
||||
//else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<unsigned short>",unsigned short)
|
||||
@@ -655,7 +655,7 @@ public:
|
||||
else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<int>",int)
|
||||
else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<float>",float)
|
||||
else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<double>",double)
|
||||
|
||||
|
||||
//else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<string>",std::string)
|
||||
//else TOOLS_RROOT_NTUPLE_CREATE_VEC_COL("vector<unsigned long>",uint64) //beurk
|
||||
|
||||
@@ -736,7 +736,7 @@ protected:
|
||||
// for gopaw :
|
||||
|
||||
class fac_tree_holder {
|
||||
public:
|
||||
public:
|
||||
fac_tree_holder(ifac* a_fac,tree* a_tree):m_fac(a_fac),m_tree(a_tree){} //own a_fac,a_tree.
|
||||
virtual ~fac_tree_holder() {delete m_tree;delete m_fac;}
|
||||
protected:
|
||||
@@ -755,7 +755,7 @@ public:
|
||||
return s_v;
|
||||
}
|
||||
virtual const std::string& s_cls() const {return s_class();}
|
||||
public:
|
||||
public:
|
||||
fac_tree_ntuple(ifac* a_fac,tree* a_tree) //own these.
|
||||
:fac_tree_holder(a_fac,a_tree)
|
||||
,parent(*a_tree) //deleted first.
|
||||
|
||||
@@ -198,7 +198,7 @@ protected:
|
||||
bool own = (*itb);
|
||||
parent::erase(it);
|
||||
m_owns.erase(itb);
|
||||
if(own) delete entry;
|
||||
if(own) delete entry;
|
||||
}
|
||||
}
|
||||
protected:
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
namespace tools {
|
||||
namespace rroot {
|
||||
|
||||
class obj_list : public virtual iro, public std::vector<iro*> {
|
||||
class obj_list : public virtual iro, protected std::vector<iro*> { //proteced to avoid using std::vector::clear().
|
||||
typedef std::vector<iro*> parent;
|
||||
public:
|
||||
static const std::string& s_store_class() {
|
||||
@@ -135,12 +135,19 @@ public:
|
||||
|
||||
return *this;
|
||||
}
|
||||
public:
|
||||
public:
|
||||
parent::const_iterator begin() const {return parent::begin();}
|
||||
parent::iterator begin() {return parent::begin();}
|
||||
parent::const_iterator end() const {return parent::end();}
|
||||
parent::iterator end() {return parent::end();}
|
||||
parent::size_type size() const {return parent::size();}
|
||||
bool empty() const {return parent::empty();}
|
||||
public:
|
||||
void add_object(iro* a_obj) { //take ownership.
|
||||
parent::push_back(a_obj);
|
||||
m_owns.push_back(true);
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
T* get_entry(std::ostream& a_out,size_t a_index) const {
|
||||
if(a_index>=size()) return 0;
|
||||
@@ -154,7 +161,7 @@ public:
|
||||
}
|
||||
return od;
|
||||
}
|
||||
|
||||
|
||||
void safe_clear() {
|
||||
typedef parent::iterator it_t;
|
||||
typedef std::vector<bool>::iterator itb_t;
|
||||
@@ -165,9 +172,11 @@ public:
|
||||
bool own = (*itb);
|
||||
parent::erase(it);
|
||||
m_owns.erase(itb);
|
||||
if(own) delete entry;
|
||||
if(own) delete entry;
|
||||
}
|
||||
}
|
||||
|
||||
void cleanup() {safe_clear();}
|
||||
protected:
|
||||
ifac& m_fac;
|
||||
std::vector<bool> m_owns;
|
||||
|
||||
@@ -72,7 +72,7 @@ inline directory* find_path_dir(directory& a_from,const std::string& a_path) {
|
||||
}
|
||||
|
||||
inline bool read_key(std::ostream& a_out,ifile& a_file,key& a_key,bool a_dump){
|
||||
unsigned int sz;
|
||||
unsigned int sz;
|
||||
char* buf = a_key.get_object_buffer(a_file,sz); //we don't have ownership of buf.
|
||||
if(!buf) {
|
||||
a_out << "tools::rroot::read_key : can't get data buffer of " << a_key.object_name() << "." << std::endl;
|
||||
@@ -183,7 +183,7 @@ inline bool read_key(std::ostream& a_out,ifile& a_file,key& a_key,bool a_dump){
|
||||
if(a_dump) {
|
||||
tree.dump(a_out,""," ");
|
||||
|
||||
uint64 entries = tree.entries();
|
||||
uint64 entries = tree.entries();
|
||||
|
||||
/*
|
||||
{for(uint32 j=0;j<10;j++){ //to test memory.
|
||||
@@ -192,16 +192,16 @@ inline bool read_key(std::ostream& a_out,ifile& a_file,key& a_key,bool a_dump){
|
||||
if(!tree.find_entry(i,n)) {
|
||||
a_out << " can't find entry " << i
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
*/
|
||||
|
||||
|
||||
{for(uint32 i=0;i<5;i++){
|
||||
if(!tree.show(a_out,i)) {
|
||||
a_out << " show failed for entry " << i
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
}}
|
||||
{for(uint64 i=mx<int64>(5,entries-5);i<entries;i++){
|
||||
if(!tree.show(a_out,(uint32)i)) {
|
||||
@@ -209,10 +209,10 @@ inline bool read_key(std::ostream& a_out,ifile& a_file,key& a_key,bool a_dump){
|
||||
<< std::endl;
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef TOOLS_RROOT_NOT_OSC
|
||||
} else if(a_key.object_class()==osc::s_h1d()) {
|
||||
|
||||
@@ -272,7 +272,7 @@ inline bool read_key(std::ostream& a_out,ifile& a_file,key& a_key,bool a_dump){
|
||||
|
||||
} else if(a_key.object_class()==THistogram_cls()) { //produced with osc/AIDA through BatchLab/Rio/THistogram.
|
||||
|
||||
pd_data_t data;
|
||||
pd_data_t data;
|
||||
annotations_t annotations;
|
||||
if(!read_THistogram(b,data,annotations)) {
|
||||
a_out << "tools::rroot::read_key : read_THistogram() failed." << std::endl;
|
||||
@@ -447,7 +447,7 @@ inline tree* key_to_tree(ifile& a_file,ifac& a_fac,key& a_key,bool a_warn = true
|
||||
if(a_warn) out << "tools::rroot::key_to_tree : key not a TTree." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
unsigned int sz;
|
||||
unsigned int sz;
|
||||
char* buf = a_key.get_object_buffer(a_file,sz); //we don't have ownership of buf.
|
||||
if(!buf) {
|
||||
out << "tools::rroot::key_to_tree : can't get data buffer of " << a_key.object_name() << "." << std::endl;
|
||||
@@ -462,7 +462,7 @@ inline tree* key_to_tree(ifile& a_file,ifac& a_fac,key& a_key,bool a_warn = true
|
||||
return 0;
|
||||
}
|
||||
return _tree;
|
||||
}
|
||||
}
|
||||
|
||||
inline void read(std::ostream& a_out,
|
||||
ifile& a_file,
|
||||
@@ -501,8 +501,8 @@ inline void read(std::ostream& a_out,
|
||||
|
||||
if(!a_recursive) continue;
|
||||
|
||||
uint32 sz;
|
||||
char* buf = k.get_object_buffer(a_file,sz);
|
||||
uint32 sz;
|
||||
char* buf = k.get_object_buffer(a_file,sz);
|
||||
if(!buf) {
|
||||
a_out << "read :"
|
||||
<< " can't get directory data buffer."
|
||||
|
||||
@@ -67,8 +67,8 @@ class rbuf {
|
||||
/////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
static const std::string& s_class() {
|
||||
static const std::string s_v("tools::rroot::rbuf");
|
||||
return s_v;
|
||||
@@ -232,15 +232,15 @@ public:
|
||||
a_x.clear();
|
||||
return false;
|
||||
}
|
||||
a_x.resize(nchars);
|
||||
a_x.resize(nchars);
|
||||
::memcpy((char*)a_x.c_str(),m_pos,nchars);
|
||||
m_pos += nchars;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool read(bool& x){
|
||||
bool read(bool& x){
|
||||
unsigned char uc = 0;
|
||||
bool status = read(uc);
|
||||
bool status = read(uc);
|
||||
x = uc?true:false;
|
||||
return status;
|
||||
}
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
bool read_array(uint32 a_sz,T*& a_a,uint32& a_n) {
|
||||
a_n = 0;
|
||||
@@ -318,7 +318,7 @@ public:
|
||||
a_n = n;}
|
||||
|
||||
if(!a_n) return true;
|
||||
|
||||
|
||||
uint32 l = a_n * sizeof(T);
|
||||
if(!check_eob(l)) return false;
|
||||
|
||||
@@ -333,7 +333,7 @@ public:
|
||||
}
|
||||
|
||||
if(m_byte_swap) {
|
||||
for(uint32 i=0;i<a_n;i++) {
|
||||
for(uint32 i=0;i<a_n;i++) {
|
||||
if(!read(*(a_a+i))) {
|
||||
if(owner) {delete [] a_a;a_a = 0;}
|
||||
a_n = 0;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace rroot {
|
||||
typedef int64 seek;
|
||||
typedef int seek32;
|
||||
|
||||
inline uint32 big_file_version_tag() {return 1000;}
|
||||
inline uint32 big_file_version_tag() {return 1000;}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
//::printf("debug : stl_vector : %d\n",num);
|
||||
|
||||
if(num) {
|
||||
if(num) {
|
||||
T* vec = new T[num];
|
||||
if(!a_buffer.read_fast_array<T>(vec,num)) {
|
||||
delete [] vec;
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
}
|
||||
std::vector<T>::resize(num);
|
||||
T* pos = vec;
|
||||
for(unsigned int index=0;index<num;index++,pos++) {
|
||||
for(unsigned int index=0;index<num;index++,pos++) {
|
||||
std::vector<T>::operator[](index) = *pos;
|
||||
}
|
||||
delete [] vec;
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
template <class T>
|
||||
class stl_vector_vector
|
||||
:public virtual iro
|
||||
,public std::vector< std::vector<T> >
|
||||
,public std::vector< std::vector<T> >
|
||||
{
|
||||
static const std::string& s_store_class() {
|
||||
static const std::string s_v("vector<vector<"+stype(T())+"> >");
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
//::printf("debug : stl_vector_vector : index %d num %d\n",veci,num);
|
||||
if(num) {
|
||||
if(num) {
|
||||
T* vec = new T[num];
|
||||
if(!a_buffer.read_fast_array<T>(vec,num)) {
|
||||
delete [] vec;
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
//::printf("debug : stl_vector_string : %d\n",num);
|
||||
|
||||
std::vector<std::string>::resize(num);
|
||||
for(unsigned int index=0;index<num;index++) {
|
||||
for(unsigned int index=0;index<num;index++) {
|
||||
std::string& vs = std::vector<std::string>::operator[](index);
|
||||
if(!a_buffer.read(vs)) {
|
||||
std::vector<std::string>::clear();
|
||||
|
||||
@@ -176,7 +176,7 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
|
||||
if(!Axis_stream(a_buffer,a_data.m_axes[2])) return false; //fZAxis
|
||||
a_data.m_axes[2].m_offset = a_data.m_axes[1].m_offset * (a_data.m_axes[1].bins()+2);
|
||||
|
||||
|
||||
} else if(a_data.m_dimension==2) {
|
||||
if(!Axis_stream(a_buffer,a_data.m_axes[1])) return false; //fYAxis
|
||||
a_data.m_axes[1].m_offset = a_data.m_axes[0].m_offset * (a_data.m_axes[0].bins()+2);
|
||||
@@ -219,7 +219,7 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
|
||||
std::vector<double> sumw2; //fSumw2 TArrayD
|
||||
if(!Array_stream<double>(a_buffer,sumw2)) return false;
|
||||
|
||||
|
||||
{std::string opt;
|
||||
if(!a_buffer.read(opt)) return false; //TString fOption
|
||||
//look if it is an "annotation trick" :
|
||||
@@ -240,7 +240,7 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
if(vers>=4) {
|
||||
int BufferSize;
|
||||
if(!a_buffer.read(BufferSize)) return false;
|
||||
|
||||
|
||||
//Double_t* Buffer; //[fBufferSize]
|
||||
if(!dummy_array_stream<double>(a_buffer,BufferSize)) return false;
|
||||
}
|
||||
@@ -304,10 +304,10 @@ inline bool TH_read_2D(buffer& a_buffer,hd_data& a_data,
|
||||
|
||||
double Tsumwxy;
|
||||
if(!a_buffer.read(Tsumwxy)) return false;
|
||||
a_data.m_in_range_plane_Sxyw[0] = Tsumwxy;
|
||||
a_data.m_in_range_plane_Sxyw[0] = Tsumwxy;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TH2")) return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -341,9 +341,9 @@ inline bool TH_read_3D(buffer& a_buffer,hd_data& a_data,
|
||||
double Tsumwyz;
|
||||
if(!a_buffer.read(Tsumwyz)) return false;
|
||||
|
||||
a_data.m_in_range_plane_Sxyw[0] = Tsumwxy;
|
||||
a_data.m_in_range_plane_Sxyw[1] = Tsumwyz;
|
||||
a_data.m_in_range_plane_Sxyw[2] = Tsumwxz;
|
||||
a_data.m_in_range_plane_Sxyw[0] = Tsumwxy;
|
||||
a_data.m_in_range_plane_Sxyw[1] = Tsumwyz;
|
||||
a_data.m_in_range_plane_Sxyw[2] = Tsumwxz;
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,"TH3")) return false;
|
||||
|
||||
@@ -514,7 +514,7 @@ inline histo::h2d* TH2F_stream(buffer& a_buffer){
|
||||
data.m_in_range_Sx2w[0] = fSx2w;
|
||||
data.m_in_range_Sxw[1] = fSyw;
|
||||
data.m_in_range_Sx2w[1] = fSy2w;
|
||||
|
||||
|
||||
histo::h2d* h = new histo::h2d("",10,0,1,10,0,1);
|
||||
h->copy_from_data(data);
|
||||
return h;
|
||||
@@ -573,7 +573,7 @@ inline histo::h2d* TH2D_stream(buffer& a_buffer){
|
||||
data.m_in_range_Sx2w[0] = fSx2w;
|
||||
data.m_in_range_Sxw[1] = fSyw;
|
||||
data.m_in_range_Sx2w[1] = fSy2w;
|
||||
|
||||
|
||||
histo::h2d* h = new histo::h2d("",10,0,1,10,0,1);
|
||||
h->copy_from_data(data);
|
||||
return h;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace rroot {
|
||||
|
||||
inline const std::string& TTree_cls(){
|
||||
static const std::string s_v("TTree");
|
||||
return s_v;
|
||||
return s_v;
|
||||
}
|
||||
|
||||
class tree : public virtual iobject {
|
||||
@@ -61,7 +61,7 @@ protected:
|
||||
tree& operator=(const tree&){return *this;}
|
||||
public:
|
||||
std::ostream& out() const {return m_out;}
|
||||
|
||||
|
||||
ifile& file() {return m_file;}
|
||||
ifac& fac() {return m_fac;}
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
<< std::endl;
|
||||
_dump_branches(a_out,m_branches,a_spaces+a_indent,a_indent);
|
||||
}
|
||||
|
||||
|
||||
branch* find_branch(const std::string& a_name,bool a_recursive = false) const {
|
||||
return _find_branch(m_branches,a_name,a_recursive);
|
||||
}
|
||||
@@ -104,19 +104,19 @@ public:
|
||||
base_leaf* find_leaf(const std::string& a_name,bool a_recursive = false) const {
|
||||
return _find_leaf(m_branches,a_name,a_recursive);
|
||||
}
|
||||
|
||||
|
||||
void find_leaves(std::vector<base_leaf*>& a_leaves) const {
|
||||
a_leaves.clear();
|
||||
_find_leaves(m_branches,a_leaves);
|
||||
}
|
||||
|
||||
|
||||
void find_branches(std::vector<branch*>& a_branches) const {
|
||||
a_branches.clear();
|
||||
_find_branches(m_branches,a_branches);
|
||||
}
|
||||
|
||||
|
||||
branch* find_leaf_branch(const base_leaf& a_leaf) const {return _find_leaf_branch(m_branches,a_leaf);}
|
||||
|
||||
|
||||
bool show(std::ostream& a_out,uint64 a_entry){
|
||||
a_out << "======> EVENT:" << a_entry << std::endl;
|
||||
tools_vforit(branch*,m_branches,it) {
|
||||
@@ -316,9 +316,9 @@ public:
|
||||
|
||||
//TObjArray
|
||||
// We read leaves in order to keep streaming synchronisation.
|
||||
// In fact m_leaves are references to existing leaves read by
|
||||
// In fact m_leaves are references to existing leaves read by
|
||||
// the branches in the upper line of code.
|
||||
//::printf("debug : tree : read leaves : begin\n");
|
||||
//::printf("debug : tree : read leaves : begin\n");
|
||||
{obj_array<base_leaf> m_leaves(m_fac);
|
||||
//branch b(m_out,m_fac);
|
||||
ifac::args args;
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//m_saved_bytes = m_tot_bytes;
|
||||
{std::vector<double> v;
|
||||
@@ -366,8 +366,8 @@ public:
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(vers>=16) {
|
||||
//TList* fUserInfo
|
||||
if(!dummy_TXxx_pointer_stream(a_buffer,m_fac)) {
|
||||
@@ -383,12 +383,12 @@ public:
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,TTree_cls())) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
protected:
|
||||
void _dump_branches(std::ostream& a_out,
|
||||
const std::vector<branch*>& a_bs,
|
||||
@@ -415,8 +415,8 @@ protected:
|
||||
<< " entry_number=" << (*it)->entry_number()
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
{const std::vector<base_leaf*>& lvs = (*it)->leaves();
|
||||
tools_vforcit(base_leaf*,lvs,itl) {
|
||||
a_out << a_spaces << a_indent
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
int64 m_n;
|
||||
if(!a_buffer.read(m_n)) return false; //fN
|
||||
//::printf("debug : tree_index::stream : fN %ld\n",m_n);
|
||||
|
||||
|
||||
if(!dummy_array_stream<int64>(a_buffer,int(m_n))) return false;
|
||||
if(!dummy_array_stream<int64>(a_buffer,int(m_n))) return false;
|
||||
|
||||
|
||||
@@ -20,19 +20,19 @@ inline tree* find_tree(file& a_file,ifac& a_fac,const std::string& a_name,bool a
|
||||
out << "tools::rroot::find_tree :"
|
||||
<< " key " << sout(a_name) << " not found."
|
||||
<< std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int sz;
|
||||
unsigned int sz;
|
||||
char* buf = key->get_object_buffer(a_file,sz); //we don't have ownership of buf.
|
||||
if(!buf) {
|
||||
out << "tools::rroot::find_tree :"
|
||||
<< " can't get data buffer of "
|
||||
<< sout(key->object_name()) << "."
|
||||
<< std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//out << "tools::rroot::find_tree :"
|
||||
// << " get data buffer size " << sz << "."
|
||||
// << std::endl;
|
||||
@@ -43,33 +43,33 @@ inline tree* find_tree(file& a_file,ifac& a_fac,const std::string& a_name,bool a
|
||||
<< sout(key->object_class())
|
||||
<< " is not a TTree."
|
||||
<< std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
buffer b(out,a_file.byte_swap(),sz,buf,key->key_length(),false);
|
||||
b.set_map_objs(a_map_objs);
|
||||
|
||||
|
||||
tree* _tree = new tree(a_file,a_fac);
|
||||
if(!_tree->stream(b)) {
|
||||
out << "tools::rroot::find_tree :"
|
||||
<< " TTree streaming failed"
|
||||
<< std::endl;
|
||||
delete _tree;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return _tree;
|
||||
|
||||
return _tree;
|
||||
}
|
||||
|
||||
inline branch_element* find_be(tree& a_tree,const std::string& a_name){
|
||||
std::ostream& out = a_tree.file().out();
|
||||
|
||||
|
||||
branch* _branch = a_tree.find_branch(a_name,true);
|
||||
if(!_branch) {
|
||||
out << "tools::rroot::find_be :"
|
||||
<< " branch not found."
|
||||
<< std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
branch_element* be = id_cast<branch,branch_element>(*_branch);
|
||||
@@ -77,9 +77,9 @@ inline branch_element* find_be(tree& a_tree,const std::string& a_name){
|
||||
out << "tools::rroot::find_be :"
|
||||
<< " branch not a branch_element."
|
||||
<< std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return be;
|
||||
}
|
||||
|
||||
@@ -90,14 +90,14 @@ inline stl_vector<T>* find_vec(ifile& a_file,branch_element& a_be,uint64 a_event
|
||||
unsigned int n;
|
||||
if(!a_be.find_entry(a_file,a_event,n)) {
|
||||
out << "tools::rroot::find_vec : branch_element.find_entry() failed." << std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
iro* o = a_be.object();
|
||||
stl_vector<T>* od = id_cast<iro, stl_vector<T> >(*o);
|
||||
if(!od) {
|
||||
out << "tools::rroot::find_vec : object not a tools::rroot::stl_vector<T>." << std::endl;
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return od; //WARNING : we are not owner.
|
||||
|
||||
@@ -43,14 +43,14 @@ public:
|
||||
if(!a_buffer.read_version(v,s,c)) return false;
|
||||
|
||||
//printf("debug : tools::rroot::vector3::stream : version %d\n",v);
|
||||
|
||||
|
||||
{uint32 id,bits;
|
||||
if(!Object_stream(a_buffer,id,bits)) return false;}
|
||||
|
||||
|
||||
if(!a_buffer.read(m_x)) return false;
|
||||
if(!a_buffer.read(m_y)) return false;
|
||||
if(!a_buffer.read(m_z)) return false;
|
||||
|
||||
|
||||
if(!a_buffer.check_byte_count(s,c,s_store_class())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user