Go to the documentation of this file.
4 #ifndef tools_rroot_leaf
5 #define tools_rroot_leaf
15 static const std::string s_v(
"TLeafB");
19 static const std::string s_v(
"TLeafS");
23 static const std::string s_v(
"TLeafI");
27 static const std::string s_v(
"TLeafF");
31 static const std::string s_v(
"TLeafD");
35 static const std::string s_v(
"TLeafO");
40 static const std::string s_v(
"tools::rroot::leaf<float>");
44 static const std::string s_v(
"tools::rroot::leaf<double>");
48 static const std::string s_v(
"tools::rroot::leaf<int>");
52 static const std::string s_v(
"tools::rroot::leaf<bool>");
62 static const std::string s_v(
"tools::rroot::leaf<"+
stype(T())+
">");
66 virtual void*
cast(
const std::string& a_class)
const {
74 if(
void* p = cmp_cast<leaf>(
this,a_class)) {
return p;}
92 leaf<int>* leaf_i = safe_cast<base_leaf, leaf<int> >(*m_leaf_count);
94 m_out <<
"tools::rroot::leaf::read_buffer : leaf_count not a leaf<int>." << std::endl;
98 if(!leaf_i->
value(0,len)) {
99 m_out <<
"tools::rroot::leaf::read_buffer : leaf<int>.value() failed."
101 <<
" leaf_i " << leaf_i
103 <<
" Size " << leaf_i->
num_elem() << std::endl;
108 m_out <<
"tools::rroot::leaf::read_buffer : warning : " <<
sout(
name())
109 <<
", len = " << len <<
" > max = "
110 << leaf_i->
get_max() << std::endl;
130 m_out <<
"tools::rroot::leaf::read_buffer : \"" <<
name() <<
"\" :"
131 <<
" read_fast_array failed."
145 m_out <<
"tools::rroot::leaf::read_buffer :"
146 <<
" read_fast_array failed. m_length " <<
m_length
152 m_out <<
"tools::rroot::leaf::read_buffer :"
153 <<
" read_fast_array failed. m_length is zero."
162 if(a_index>=
m_size)
return false;
187 if(!
m_value) {a_value = T();
return false;}
188 if(a_index>=
m_size) {a_value = T();
return false;}
192 bool value(std::vector<T>& a_v)
const {
193 if(!
m_value) {a_v.clear();
return false;}
208 static const std::string& s_store_class() {
209 static const std::string s_v(
"TLeafC");
214 static const std::string s_v(
"tools::rroot::leaf_string");
218 virtual void*
cast(
const std::string& a_class)
const {
219 if(
void* p = cmp_cast<leaf_string>(
this,a_class)) {
return p;}
226 if(
void* p = cmp_cast<leaf_string>(
this,a_class)) {
return p;}
246 unsigned char lenchar;
247 if(!a_buffer.
read(lenchar)) {
248 m_out <<
"tools::rroot::leaf_string::read_buffer :"
249 <<
" read(uchar) failed."
257 if(!a_buffer.
read(len)) {
258 m_out <<
"tools::rroot::leaf_string::read_buffer :"
259 <<
" read(int) failed."
274 m_out <<
"tools::rroot::leaf_string::read_buffer :"
275 <<
" read_fast_array failed."
315 static const std::string& s_store_class() {
316 static const std::string s_v(
"TLeafElement");
321 static const std::string s_v(
"tools::rroot::leaf_element");
325 virtual void*
cast(
const std::string& a_class)
const {
326 if(
void* p = cmp_cast<leaf_element>(
this,a_class)) {
return p;}
333 if(
void* p = cmp_cast<leaf_element>(
this,a_class)) {
return p;}
343 if(!a_buffer.
read(
fID))
return false;
350 m_out <<
"tools::rroot::leaf_element::read_buffer : dummy." << std::endl;
379 static const std::string& s_store_class() {
380 static const std::string s_v(
"TLeafObject");
385 static const std::string s_v(
"tools::rroot::leaf_object");
389 virtual void*
cast(
const std::string& a_class)
const {
390 if(
void* p = cmp_cast<leaf_object>(
this,a_class)) {
return p;}
397 if(
void* p = cmp_cast<leaf_object>(
this,a_class)) {
return p;}
414 m_out <<
"tools::rroot::leaf_object::read_buffer : m_obj is null." << std::endl;
417 std::string fClassName;
420 if(!a_buffer.
read(n)) {
421 m_out <<
"tools::rroot::leaf_object::read_buffer :"
422 <<
" read(unsigned char) failed."
428 m_out <<
"tools::rroot::leaf_object::read_buffer :"
429 <<
" readFastArray failed."
433 fClassName = classname;
436 m_out <<
"tools::rroot::leaf_object::read_buffer : WARNING : class mismatch :"
437 <<
" fClassName " <<
sout(fClassName)
443 m_out <<
"tools::rroot::leaf_object::read_buffer :"
444 <<
" object stream failed."