inlib  1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
inlib::rroot::base_leaf Class Reference
Inheritance diagram for inlib::rroot::base_leaf:
Inheritance graph
[legend]
Collaboration diagram for inlib::rroot::base_leaf:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void * cast (const std::string &a_class) const
virtual bool stream (buffer &a_buffer)
virtual bool read_basket (buffer &)=0
virtual bool print_value (std::ostream &, uint32) const =0
virtual uint32 num_elem () const =0
virtual const std::string & s_cls () const =0
 base_leaf (std::ostream &a_out, rroot::branch &a_branch, ifac &a_fac)
virtual ~base_leaf ()
rroot::branchbranch ()
const std::string & name () const
const std::string & title () const

Static Public Member Functions

static const std::string & s_class ()

Protected Member Functions

 base_leaf (const base_leaf &a_from)
base_leafoperator= (const base_leaf &)

Protected Attributes

std::ostream & m_out
rroot::branchm_branch
ifacm_fac
std::string m_name
std::string m_title
uint32 m_ndata
uint32 m_length
 Number of elements in fAddress data buffer.
base_leafm_leaf_count

Detailed Description

Definition at line 21 of file base_leaf.


Constructor & Destructor Documentation

inlib::rroot::base_leaf::base_leaf ( std::ostream &  a_out,
rroot::branch a_branch,
ifac a_fac 
) [inline]

Definition at line 97 of file base_leaf.

  :m_out(a_out)
  ,m_branch(a_branch)
  ,m_fac(a_fac)
  ,m_name("")
  ,m_title("")

  //,fIndirectAddress(false)
  //,fNewValue(false)
  ,m_ndata(0)
  ,m_length(0)
/*
  ,fLengthType(0)
  ,fOffset(0)
  ,fIsRange(false)
  ,fIsUnsigned(false)
*/
  ,m_leaf_count(0)
  {
#ifdef INLIB_MEM
    mem::increment(s_class().c_str());
#endif
  }
virtual inlib::rroot::base_leaf::~base_leaf ( ) [inline, virtual]

Definition at line 120 of file base_leaf.

                      {
    delete m_leaf_count;
#ifdef INLIB_MEM
    mem::decrement(s_class().c_str());
#endif
  }
inlib::rroot::base_leaf::base_leaf ( const base_leaf a_from) [inline, protected]

Definition at line 127 of file base_leaf.

  : iro(a_from)
  ,m_out(a_from.m_out)
  ,m_branch(a_from.m_branch)
  ,m_fac(a_from.m_fac)
  {}

Member Function Documentation

rroot::branch& inlib::rroot::base_leaf::branch ( ) [inline]

Definition at line 135 of file base_leaf.

{return m_branch;}
virtual void* inlib::rroot::base_leaf::cast ( const std::string &  a_class) const [inline, virtual]

Implements inlib::rroot::iro.

Reimplemented in inlib::rroot::leaf_element, inlib::rroot::leaf_string, and inlib::rroot::leaf< T >.

Definition at line 28 of file base_leaf.

                                                     {
    if(void* p = inlib::cmp_cast<base_leaf>(this,a_class)) {return p;}
    else return 0;
  }
const std::string& inlib::rroot::base_leaf::name ( ) const [inline]

Definition at line 136 of file base_leaf.

{return m_name;}
virtual uint32 inlib::rroot::base_leaf::num_elem ( ) const [pure virtual]
base_leaf& inlib::rroot::base_leaf::operator= ( const base_leaf ) [inline, protected]

Definition at line 133 of file base_leaf.

{return *this;}
virtual bool inlib::rroot::base_leaf::print_value ( std::ostream &  ,
uint32   
) const [pure virtual]
virtual bool inlib::rroot::base_leaf::read_basket ( buffer ) [pure virtual]
static const std::string& inlib::rroot::base_leaf::s_class ( ) [inline, static]

Reimplemented in inlib::rroot::leaf_element, inlib::rroot::leaf_string, and inlib::rroot::leaf< T >.

Definition at line 23 of file base_leaf.

                                    {
    static const std::string s_v("inlib::rroot::base_leaf");
    return s_v;
  }
virtual const std::string& inlib::rroot::base_leaf::s_cls ( ) const [pure virtual]
virtual bool inlib::rroot::base_leaf::stream ( buffer a_buffer) [inline, virtual]

Implements inlib::rroot::iro.

Reimplemented in inlib::rroot::leaf_element, inlib::rroot::leaf_string, and inlib::rroot::leaf< T >.

Definition at line 32 of file base_leaf.

                                        {
    delete m_leaf_count;
    m_leaf_count = 0;

    int fLengthType;
    int fOffset;
    bool fIsRange;
    bool fIsUnsigned;

    short v;
    unsigned int s,c;
    if(!a_buffer.read_version(v,s,c)) return false;
    //FIXME if (v > 1) {
    //TLeaf::Class()->ReadBuffer(b, this, R__v, R__s, R__c);
    //FIXME } else {
    //====process old versions before automatic schema evolution
    if(!Named_stream(a_buffer,m_name,m_title)) return false;

    // Ok with v 1 & 2
    if(!a_buffer.read(m_length)) return false;
    if(!a_buffer.read(fLengthType)) return false;
    if(!a_buffer.read(fOffset)) return false;
    if(!a_buffer.read(fIsRange)) return false;
    if(!a_buffer.read(fIsUnsigned)) return false;

   {ifac::args args;
    args[ifac::arg_branch()] = &m_branch;
    iro* obj;
    if(!a_buffer.read_object(m_fac,args,obj)) {
      m_out << "inlib::rroot::base_leaf::stream :"
            << " can't read object." 
            << std::endl;
      return false;
    }
    if(!obj) {
      //m_out << "inlib::rroot::base_leaf::stream :"
      //      << " null leaf count object." 
      //      << std::endl;
    } else {
      m_leaf_count = inlib::cast<iro,base_leaf>(*obj);
      if(!m_leaf_count) {
        m_out << "inlib::rroot::base_leaf::stream :"
              << " can't cast base_leaf." 
              << std::endl;
        m_leaf_count = 0;
        delete obj;
        return false;
      }
    }}

    if(!a_buffer.check_byte_count(s,c,"TLeaf")) return false;

    if(!m_length) m_length = 1;
/*
    fNewValue = false;
    if(!setAddress(0)) return false;
*/
    return true;
  }
const std::string& inlib::rroot::base_leaf::title ( ) const [inline]

Definition at line 137 of file base_leaf.

{return m_title;}

Member Data Documentation

Definition at line 164 of file base_leaf.

Definition at line 165 of file base_leaf.

Definition at line 179 of file base_leaf.

Number of elements in fAddress data buffer.

Definition at line 172 of file base_leaf.

std::string inlib::rroot::base_leaf::m_name [protected]

Definition at line 167 of file base_leaf.

Definition at line 171 of file base_leaf.

std::ostream& inlib::rroot::base_leaf::m_out [protected]

Definition at line 163 of file base_leaf.

std::string inlib::rroot::base_leaf::m_title [protected]

Definition at line 168 of file base_leaf.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines