g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::wroot::leaf_object Class Reference
Inheritance diagram for tools::wroot::leaf_object:
Inheritance graph
[legend]
Collaboration diagram for tools::wroot::leaf_object:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (cid a_class) const
 
virtual cid id_cls () const
 
virtual const std::string & store_cls () const
 
virtual bool stream (buffer &a_buffer) const
 
virtual bool fill_buffer (buffer &a_buffer) const
 
 leaf_object (std::ostream &a_out, const std::string &a_name, const iobject &a_obj)
 
virtual ~leaf_object ()
 
- Public Member Functions inherited from tools::wroot::base_leaf
 base_leaf (std::ostream &a_out, const std::string &a_name, const std::string &a_title)
 
virtual ~base_leaf ()
 
const std::string & name () const
 
void set_title (const std::string &a_value)
 
uint32 length () const
 
void set_length (uint32 a_value)
 
void set_is_range (bool a_value)
 
- Public Member Functions inherited from tools::wroot::ibo
virtual ~ibo ()
 

Static Public Member Functions

static cid id_class ()
 
- Static Public Member Functions inherited from tools::wroot::base_leaf
static cid id_class ()
 

Protected Member Functions

 leaf_object (const leaf_object &a_from)
 
leaf_objectoperator= (const leaf_object &a_from)
 
- Protected Member Functions inherited from tools::wroot::base_leaf
 base_leaf (const base_leaf &a_from)
 
base_leafoperator= (const base_leaf &)
 

Protected Attributes

const iobjectm_obj
 
bool fVirtual
 
- Protected Attributes inherited from tools::wroot::base_leaf
std::ostream & m_out
 
std::string m_name
 
std::string m_title
 
uint32 m_length
 
uint32 m_length_type
 
ibom_leaf_count
 
bool m_is_range
 

Detailed Description

Definition at line 318 of file leaf.

Constructor & Destructor Documentation

◆ leaf_object() [1/2]

tools::wroot::leaf_object::leaf_object ( std::ostream &  a_out,
const std::string &  a_name,
const iobject a_obj 
)
inline

Definition at line 349 of file leaf.

350  :parent(a_out,a_name,a_obj.store_class_name()) //CERN-ROOT/TLeafObject::Streamer() wants store class name on m_title.
351  ,m_obj(a_obj)
352  ,fVirtual(true)
353  {}

◆ ~leaf_object()

virtual tools::wroot::leaf_object::~leaf_object ( )
inlinevirtual

Definition at line 354 of file leaf.

354 {}

◆ leaf_object() [2/2]

tools::wroot::leaf_object::leaf_object ( const leaf_object a_from)
inlineprotected

Definition at line 356 of file leaf.

356 :ibo(a_from),parent(a_from),m_obj(a_from.m_obj),fVirtual(true){}

Member Function Documentation

◆ cast()

virtual void* tools::wroot::leaf_object::cast ( cid  a_class) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 322 of file leaf.

322  {
323  if(void* p = cmp_cast<leaf_object>(this,a_class)) {return p;}
324  return base_leaf::cast(a_class);
325  }

◆ fill_buffer()

virtual bool tools::wroot::leaf_object::fill_buffer ( buffer a_buffer) const
inlinevirtual

Implements tools::wroot::base_leaf.

Definition at line 338 of file leaf.

338  {
339  if(fVirtual) {
340  const std::string& _class = m_obj.store_class_name();
341  if(_class.size()>255) return false;
342  unsigned char n = (unsigned char)_class.size();
343  if(!a_buffer.write(n)) return false;
344  if(!a_buffer.write_fast_array(_class.c_str(),n+1)) return false;
345  }
346  return m_obj.stream(a_buffer);
347  }

◆ id_class()

static cid tools::wroot::leaf_object::id_class ( )
inlinestatic

Definition at line 321 of file leaf.

321 {return leaf_object_cid();}

◆ id_cls()

virtual cid tools::wroot::leaf_object::id_cls ( ) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 326 of file leaf.

326 {return id_class();}

◆ operator=()

leaf_object& tools::wroot::leaf_object::operator= ( const leaf_object a_from)
inlineprotected

Definition at line 357 of file leaf.

357  {
358  parent::operator=(a_from);
359  return *this;
360  }

◆ store_cls()

virtual const std::string& tools::wroot::leaf_object::store_cls ( ) const
inlinevirtual

Implements tools::wroot::ibo.

Definition at line 328 of file leaf.

328 {return leaf_object_store_class();}

◆ stream()

virtual bool tools::wroot::leaf_object::stream ( buffer a_buffer) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 329 of file leaf.

329  {
330  unsigned int c;
331  if(!a_buffer.write_version(4,c)) return false;
332  if(!parent::stream(a_buffer)) return false;
333  if(!a_buffer.write(fVirtual)) return false;
334  if(!a_buffer.set_byte_count(c)) return false;
335  return true;
336  }

Member Data Documentation

◆ fVirtual

bool tools::wroot::leaf_object::fVirtual
protected

Definition at line 363 of file leaf.

◆ m_obj

const iobject& tools::wroot::leaf_object::m_obj
protected

Definition at line 362 of file leaf.


The documentation for this class was generated from the following file:
tools::wroot::leaf_object_cid
cid leaf_object_cid()
Definition: cids:18
tools::wroot::leaf_object_store_class
const std::string & leaf_object_store_class()
Definition: leaf:43
tools::wroot::iobject::store_class_name
virtual const std::string & store_class_name() const =0
tools::wroot::base_leaf::cast
virtual void * cast(cid a_class) const
Definition: base_leaf:30
tools::wroot::base_leaf::operator=
base_leaf & operator=(const base_leaf &)
Definition: base_leaf:92
tools::wroot::leaf_object::id_class
static cid id_class()
Definition: leaf:321
tools::wroot::base_leaf::stream
virtual bool stream(buffer &a_buffer) const
Definition: base_leaf:36
tools::wroot::iobject::stream
virtual bool stream(buffer &) const =0
tools::wroot::leaf_object::m_obj
const iobject & m_obj
Definition: leaf:362
tools::wroot::leaf_object::fVirtual
bool fVirtual
Definition: leaf:363