inlib
1.2.0
|
Public Member Functions | |
virtual void * | cast (const std::string &a_class) const |
virtual bool | stream (buffer &a_buffer) |
virtual const std::string & | s_cls () const |
virtual bool | read_basket (buffer &a_buffer) |
virtual bool | print_value (std::ostream &a_out, uint32 a_index) const |
virtual uint32 | num_elem () const |
leaf (std::ostream &a_out, rroot::branch &a_branch, ifac &a_fac) | |
virtual | ~leaf () |
T | value (uint32 a_index=0) const |
Static Public Member Functions | |
static const std::string & | s_class () |
Protected Member Functions | |
leaf (const leaf &a_from) | |
leaf & | operator= (const leaf &) |
Protected Attributes | |
T | m_min |
T | m_max |
T * | m_value |
inlib::rroot::leaf< T >::leaf | ( | std::ostream & | a_out, |
rroot::branch & | a_branch, | ||
ifac & | a_fac | ||
) | [inline] |
virtual inlib::rroot::leaf< T >::~leaf | ( | ) | [inline, virtual] |
inlib::rroot::leaf< T >::leaf | ( | const leaf< T > & | a_from | ) | [inline, protected] |
virtual void* inlib::rroot::leaf< T >::cast | ( | const std::string & | a_class | ) | const [inline, virtual] |
Reimplemented from inlib::rroot::base_leaf.
Definition at line 55 of file leaf.
{ if(void* p = inlib::cmp_cast< leaf<T> >(this,a_class)) {return p;} else return base_leaf::cast(a_class); }
virtual uint32 inlib::rroot::leaf< T >::num_elem | ( | ) | const [inline, virtual] |
leaf& inlib::rroot::leaf< T >::operator= | ( | const leaf< T > & | ) | [inline, protected] |
virtual bool inlib::rroot::leaf< T >::print_value | ( | std::ostream & | a_out, |
uint32 | a_index | ||
) | const [inline, virtual] |
Implements inlib::rroot::base_leaf.
Definition at line 142 of file leaf.
{ //if(!m_value) return false; a_out << m_value[a_index]; return true; }
virtual bool inlib::rroot::leaf< T >::read_basket | ( | buffer & | a_buffer | ) | [inline, virtual] |
Implements inlib::rroot::base_leaf.
Definition at line 77 of file leaf.
{ if(!m_leaf_count && (m_ndata == 1)) { /* if(!aBuffer.read(m_value[0])) { std::ostream& out = this->branch().out(); out << "Rio::Leaf::readBasket : \"" << name() << "\" :" << " read value failed." << std::endl; return false; } return true; */ m_out << "inlib::rroot::leaf::read_basket :" << " case(1) not yet handled." << std::endl; return false; }else { if(m_leaf_count) { m_out << "inlib::rroot::leaf::read_basket :" << " case(2) not yet handled." << std::endl; return false; /* int len = m_leaf_count->number(); if (len > m_leaf_count->maximum()) { std::ostream& out = this->branch().out(); out << "Rio::Leaf::readBasket : \"" << name() << "\", len = " << len << " and max = " << m_leaf_count->maximum() << std::endl; len = m_leaf_count->maximum(); } m_ndata = len * fLength; if(!aBuffer.readFastArray(m_value,len * fLength)) { std::ostream& out = this->branch().out(); out << "Rio::Leaf::readBasket : \"" << name() << "\" :" << " readFastArray failed." << std::endl; return false; } return true; */ } else { if(m_length) { if(!m_value) { delete [] m_value; m_value = new T[m_length]; //we assume m_length is constant. } if(!a_buffer.read_fast_array<T>(m_value,m_length)) { m_out << "inlib::rroot::leaf::read_basket :" << " read_fast_array failed. m_length " << m_length << std::endl; return false; } return true; } else { m_out << "inlib::rroot::leaf::read_basket :" << " read_fast_array failed. m_length is zero." << std::endl; return false; } //::printf("debug : value : %d %g\n",m_value[0],m_value[0]); } } return true; }
static const std::string& inlib::rroot::leaf< T >::s_class | ( | ) | [inline, static] |
Reimplemented from inlib::rroot::base_leaf.
Definition at line 50 of file leaf.
{ static const std::string s_v("inlib::rroot::leaf<"+stype(T())+">"); return s_v; }
virtual const std::string& inlib::rroot::leaf< T >::s_cls | ( | ) | const [inline, virtual] |
virtual bool inlib::rroot::leaf< T >::stream | ( | buffer & | a_buffer | ) | [inline, virtual] |
Reimplemented from inlib::rroot::base_leaf.
Definition at line 59 of file leaf.
{ delete [] m_value; m_value = 0; short v; unsigned int s,c; if(!a_buffer.read_version(v,s,c)) return false; if(!base_leaf::stream(a_buffer)) return false; if(!a_buffer.read(m_min)) return false; if(!a_buffer.read(m_max)) return false; if(!a_buffer.check_byte_count(s,c,leaf_store_class(T()))) return false; m_value = new T[m_length]; return true; }
T inlib::rroot::leaf< T >::value | ( | uint32 | a_index = 0 | ) | const [inline] |
T inlib::rroot::leaf< T >::m_max [protected] |
T inlib::rroot::leaf< T >::m_min [protected] |
T* inlib::rroot::leaf< T >::m_value [protected] |