inlib  1.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
inlib::rroot::leaf_string Class Reference
Inheritance diagram for inlib::rroot::leaf_string:
Inheritance graph
[legend]
Collaboration diagram for inlib::rroot::leaf_string:
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 const std::string & s_cls () const
virtual bool read_basket (buffer &a_buffer)
virtual bool print_value (std::ostream &a_out, uint32) const
virtual uint32 num_elem () const
 leaf_string (std::ostream &a_out, rroot::branch &a_branch, ifac &a_fac)
virtual ~leaf_string ()
const char * value () const

Static Public Member Functions

static const std::string & s_class ()

Protected Member Functions

 leaf_string (const leaf_string &a_from)
leaf_stringoperator= (const leaf_string &)

Protected Attributes

int m_min
int m_max
char * m_value

Detailed Description

Definition at line 172 of file leaf.


Constructor & Destructor Documentation

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

Definition at line 250 of file leaf.

  : base_leaf(a_out,a_branch,a_fac)
  ,m_min(0),m_max(0),m_value(0){}
virtual inlib::rroot::leaf_string::~leaf_string ( ) [inline, virtual]

Definition at line 253 of file leaf.

                        {
    delete [] m_value;
  }
inlib::rroot::leaf_string::leaf_string ( const leaf_string a_from) [inline, protected]

Definition at line 257 of file leaf.

:iro(a_from),base_leaf(a_from){}

Member Function Documentation

virtual void* inlib::rroot::leaf_string::cast ( const std::string &  a_class) const [inline, virtual]

Reimplemented from inlib::rroot::base_leaf.

Definition at line 179 of file leaf.

                                                     {
    if(void* p = inlib::cmp_cast<leaf_string>(this,a_class)) {return p;}
    else return base_leaf::cast(a_class);
  }
virtual uint32 inlib::rroot::leaf_string::num_elem ( ) const [inline, virtual]

Implements inlib::rroot::base_leaf.

Definition at line 248 of file leaf.

{return 1;}
leaf_string& inlib::rroot::leaf_string::operator= ( const leaf_string ) [inline, protected]

Definition at line 258 of file leaf.

{return *this;}
virtual bool inlib::rroot::leaf_string::print_value ( std::ostream &  a_out,
uint32   
) const [inline, virtual]

Implements inlib::rroot::base_leaf.

Definition at line 244 of file leaf.

                                                           {
    if(m_value) a_out << m_value;
    return true;
  }
virtual bool inlib::rroot::leaf_string::read_basket ( buffer a_buffer) [inline, virtual]

Implements inlib::rroot::base_leaf.

Definition at line 195 of file leaf.

                                             {
    delete [] m_value;
    m_value = 0;

    unsigned char lenchar;
    if(!a_buffer.read(lenchar)) {
      m_out << "inlib::rroot::leaf_string::read_basket :"
            << " read(uchar) failed."
            << std::endl;
      return false;
    }
    uint32 len = 0;
    if(lenchar < 255) {
      len = lenchar;
    } else {
      if(!a_buffer.read(len)) {
        m_out << "inlib::rroot::leaf_string::read_basket :"
              << " read(int) failed."
              << std::endl;
        return false;
      }
    }
    if(len) {

      if(!m_length) {
        m_out << "inlib::rroot::leaf_string::read_basket :"
              << " m_length is zero."
              << std::endl;
        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)) {
        m_out << "inlib::rroot::leaf_string::read_basket :"
              << " read_fast_array failed."
              << std::endl;
        delete [] m_value;
        m_value = 0;
        return false;
      }
      m_value[len] = 0;
    } else {
    }

    return true;
  }
static const std::string& inlib::rroot::leaf_string::s_class ( ) [inline, static]

Reimplemented from inlib::rroot::base_leaf.

Definition at line 174 of file leaf.

                                    {
    static const std::string s_v("inlib::rroot::leaf_string");
    return s_v;
  }
virtual const std::string& inlib::rroot::leaf_string::s_cls ( ) const [inline, virtual]

Implements inlib::rroot::base_leaf.

Definition at line 194 of file leaf.

{return s_class();}
virtual bool inlib::rroot::leaf_string::stream ( buffer a_buffer) [inline, virtual]

Reimplemented from inlib::rroot::base_leaf.

Definition at line 183 of file leaf.

                                        {
    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,"TLeafC")) return false;
    return true;
  }
const char* inlib::rroot::leaf_string::value ( ) const [inline]

Definition at line 260 of file leaf.

{return m_value;}

Member Data Documentation

Definition at line 263 of file leaf.

Definition at line 262 of file leaf.

Definition at line 264 of file leaf.


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