118 static int kDouble = 8;
119 static int kDouble32 = 9;
120 static int kUInt = 13;
121 static int kBits = 15;
122 static int kObject = 61;
123 static int kObjectP = 64;
128 if(!a_buffer.read(n))
return false;
154 }
else if(
fType==31) {
157 #ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
158 ::printf(
"debug : %s : fClassName %s : fID %d : kObject : ndata %d\n",
m_name.c_str(),
fClassName.c_str(),
fID,ndata);
160 streamer_info* _info = a_file.find_streamer_info(
fClassName);
162 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
163 <<
" read(kObject) : streamer_infos for ref_cls " <<
fClassName <<
" not found."
167 streamer_element* _element = _info->find_streamer_element(
fID);
169 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
170 <<
" read(kObject) : for ref_cls " <<
fClassName <<
", fID " <<
fID <<
" streamer element not found."
178 _list =
new obj_list(
m_fac);
181 _list = id_cast<iro,obj_list>(*
m_obj);
183 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
184 <<
" read(kObject) : m_obj is not an obj_list."
192 for(
int index=0;index<ndata;index++) {
194 iro* _obj =
m_fac.
create(_element->type_name(),args);
195 if(!_obj) {_list->safe_clear();
return false;}
196 if(!_obj->stream(a_buffer)){
197 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
198 <<
" kObject : obj stream of class " << sout(_element->type_name())
199 <<
" failed at index " << index <<
" (" << ndata <<
")." << std::endl;
203 _list->add_object(_obj);
212 #ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
213 ::printf(
"debug : %s : fID %d : double32 : ndata %d\n",
m_name.c_str(),
fID,ndata);
215 stl_vector<double>* vec = 0;
217 vec =
new stl_vector<double>;
220 vec = id_cast<iro, stl_vector<double> >(*m_obj);
222 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
223 <<
" read(kDouble32) : m_obj is not a stl_vector<double>."
231 for(
int ii=0;ii<ndata;ii++) {
232 if(!a_buffer.read(afloat)) {
233 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
234 <<
" read(float) failed."
247 #ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
248 ::printf(
"debug : %s : fID %d : double : ndata %d\n",
m_name.c_str(),
fID,ndata);
250 stl_vector<double>* vec = 0;
252 vec =
new stl_vector<double>;
255 vec = id_cast<iro, stl_vector<double> >(*m_obj);
257 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
258 <<
" read(kDouble) : m_obj is not a stl_vector<double>."
266 if(!a_buffer.read_fast_array(_value,ndata)) {
267 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
268 <<
" read_fast_array(double) failed."
278 #ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
279 ::printf(
"debug : %s : fID %d : int : ndata %d\n",
m_name.c_str(),
fID,ndata);
281 stl_vector<int>* vec = 0;
283 vec =
new stl_vector<int>;
286 vec = id_cast<iro, stl_vector<int> >(*m_obj);
288 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
289 <<
" read(kInt) : m_obj is not a stl_vector<int>."
297 if(!a_buffer.read_fast_array(_value,ndata)) {
298 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
299 <<
" read_fast_array(int) failed."
309 #ifdef TOOLS_RROOT_BRANCH_ELEMENT_DUMP
311 else ::printf(
"debug : %s : fID %d : bits : ndata %d\n",
m_name.c_str(),
fID,ndata);
313 stl_vector<uint32>* vec = 0;
315 vec =
new stl_vector<uint32>;
318 vec = id_cast<iro, stl_vector<uint32> >(*m_obj);
320 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
321 <<
" read(kUInt) : m_obj is not a stl_vector<uint32>."
329 if(!a_buffer.read_fast_array(_value,ndata)) {
330 m_out <<
"tools::rroot::branch_element::read_leaves : " << sout(
m_name) <<
" :"
331 <<
" read_fast_array(uint) failed."
340 m_out <<
"tools::rroot::branch_element::read_leaves :"
358 }
else if(
fType==0) {
382 bool created =
false;
386 if(!
m_obj)
return false;
391 m_out <<
"tools::rroot::branch_element::read_leaves :"
393 <<
" obj stream failed."
402 m_out <<
"tools::rroot::branch_element::read_leaves :"
404 <<
" type 0 with ID " <<
fID <<
" not treated."
411 m_out <<
"tools::rroot::branch_element::read_leaves :"