g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rroot::ntuple::column_element_ref< RT, T > Class Template Reference
Inheritance diagram for tools::rroot::ntuple::column_element_ref< RT, T >:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::ntuple::column_element_ref< RT, T >:
Collaboration graph
[legend]

Public Member Functions

virtual void * cast (cid a_class) const
 
virtual cid id_cls () const
 
virtual const std::string & name () const
 
virtual bool fetch_entry () const
 
virtual bool get_entry (T &a_v) const
 
 column_element_ref (ifile &a_file, branch_element &a_branch, leaf_element &a_leaf, int64 &a_index, T &a_ref)
 
virtual ~column_element_ref ()
 
- Public Member Functions inherited from tools::read::icolumn< T >
virtual ~icolumn ()
 
- Public Member Functions inherited from tools::read::icol
virtual ~icol ()
 
virtual void stop ()
 

Static Public Member Functions

static cid id_class ()
 
- Static Public Member Functions inherited from tools::read::icolumn< T >
static cid id_class ()
 

Protected Member Functions

 column_element_ref (const column_element_ref &a_from)
 
column_element_refoperator= (const column_element_ref &a_from)
 
bool _fetch_entry () const
 

Protected Attributes

ifilem_file
 
branch_elementm_be
 
leaf_elementm_leaf
 
int64m_index
 
T & m_ref
 

Additional Inherited Members

- Public Types inherited from tools::read::icolumn< T >
typedef T entry_t
 

Detailed Description

template<class RT, class T>
class tools::rroot::ntuple::column_element_ref< RT, T >

Definition at line 392 of file ntuple.

Constructor & Destructor Documentation

◆ column_element_ref() [1/2]

template<class RT , class T >
tools::rroot::ntuple::column_element_ref< RT, T >::column_element_ref ( ifile a_file,
branch_element a_branch,
leaf_element a_leaf,
int64 a_index,
T &  a_ref 
)
inline

Definition at line 412 of file ntuple.

413  :m_file(a_file)
414  ,m_be(a_branch)
415  ,m_leaf(a_leaf)
416  ,m_index(a_index) //WARNING : we keep the ref !
417  ,m_ref(a_ref)
418  {}

◆ ~column_element_ref()

template<class RT , class T >
virtual tools::rroot::ntuple::column_element_ref< RT, T >::~column_element_ref ( )
inlinevirtual

Definition at line 419 of file ntuple.

419 {}

◆ column_element_ref() [2/2]

template<class RT , class T >
tools::rroot::ntuple::column_element_ref< RT, T >::column_element_ref ( const column_element_ref< RT, T > &  a_from)
inlineprotected

Definition at line 421 of file ntuple.

422  :read::icol(a_from),parent(a_from)
423  ,m_file(a_from.m_file)
424  ,m_be(a_from.m_be)
425  ,m_leaf(a_from.m_leaf)
426  ,m_index(a_from.m_index)
427  ,m_ref(a_from.m_ref)
428  {}

Member Function Documentation

◆ _fetch_entry()

template<class RT , class T >
bool tools::rroot::ntuple::column_element_ref< RT, T >::_fetch_entry ( ) const
inlineprotected

Definition at line 434 of file ntuple.

434  {
435  unsigned int n;
436  if(!m_be.find_entry(m_file,uint32(m_index),n)) {m_ref = T();return false;}
437  iro* obj = m_be.object(); //Not owner.
438  if(!obj) {m_ref = T();return false;}
439  RT* v = id_cast<iro,RT>(*obj);
440  if(!v) {m_ref = T();return false;}
441  m_ref = *v; //it assumes a T::operator=(RT)
442  return true;
443  }

◆ cast()

template<class RT , class T >
virtual void* tools::rroot::ntuple::column_element_ref< RT, T >::cast ( cid  a_class) const
inlinevirtual

Reimplemented from tools::read::icolumn< T >.

Reimplemented in tools::rroot::ntuple::column_element< RT, T >.

Definition at line 397 of file ntuple.

397  {
398  if(void* p = cmp_cast<column_element_ref>(this,a_class)) return p;
399  return parent::cast(a_class);
400  }

◆ fetch_entry()

template<class RT , class T >
virtual bool tools::rroot::ntuple::column_element_ref< RT, T >::fetch_entry ( ) const
inlinevirtual

Reimplemented from tools::read::icol.

Definition at line 405 of file ntuple.

405 {return _fetch_entry();}

◆ get_entry()

template<class RT , class T >
virtual bool tools::rroot::ntuple::column_element_ref< RT, T >::get_entry ( T &  a_v) const
inlinevirtual

Implements tools::read::icolumn< T >.

Definition at line 406 of file ntuple.

406  {
407  if(!_fetch_entry()) {a_v = T();return false;}
408  a_v = m_ref;
409  return true;
410  }

◆ id_class()

template<class RT , class T >
static cid tools::rroot::ntuple::column_element_ref< RT, T >::id_class ( )
inlinestatic

Definition at line 395 of file ntuple.

395 {return 300+_cid(T())+10000;}

◆ id_cls()

template<class RT , class T >
virtual cid tools::rroot::ntuple::column_element_ref< RT, T >::id_cls ( ) const
inlinevirtual

Reimplemented from tools::read::icolumn< T >.

Reimplemented in tools::rroot::ntuple::column_element< RT, T >.

Definition at line 401 of file ntuple.

401 {return id_class();}

◆ name()

template<class RT , class T >
virtual const std::string& tools::rroot::ntuple::column_element_ref< RT, T >::name ( ) const
inlinevirtual

Implements tools::read::icol.

Definition at line 403 of file ntuple.

403 {return m_leaf.name();}

◆ operator=()

template<class RT , class T >
column_element_ref& tools::rroot::ntuple::column_element_ref< RT, T >::operator= ( const column_element_ref< RT, T > &  a_from)
inlineprotected

Definition at line 429 of file ntuple.

429  {
430  if(&a_from==this) return *this;
431  return *this;
432  }

Member Data Documentation

◆ m_be

template<class RT , class T >
branch_element& tools::rroot::ntuple::column_element_ref< RT, T >::m_be
protected

Definition at line 446 of file ntuple.

◆ m_file

template<class RT , class T >
ifile& tools::rroot::ntuple::column_element_ref< RT, T >::m_file
protected

Definition at line 445 of file ntuple.

◆ m_index

template<class RT , class T >
int64& tools::rroot::ntuple::column_element_ref< RT, T >::m_index
protected

Definition at line 448 of file ntuple.

◆ m_leaf

template<class RT , class T >
leaf_element& tools::rroot::ntuple::column_element_ref< RT, T >::m_leaf
protected

Definition at line 447 of file ntuple.

◆ m_ref

template<class RT , class T >
T& tools::rroot::ntuple::column_element_ref< RT, T >::m_ref
protected

Definition at line 449 of file ntuple.


The documentation for this class was generated from the following file:
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::rroot::ntuple::column_element_ref::id_class
static cid id_class()
Definition: ntuple:395
tools::rroot::ntuple::column_element_ref::m_index
int64 & m_index
Definition: ntuple:448
tools::rroot::branch_element::find_entry
virtual bool find_entry(ifile &a_file, uint64 a_entry, uint32 &a_nbytes)
Definition: branch_element:586
tools::rroot::base_leaf::name
const std::string & name() const
Definition: base_leaf:146
tools::read::icolumn::cast
virtual void * cast(cid a_class) const
Definition: rntuple:44
tools::rroot::ntuple::column_element_ref::_fetch_entry
bool _fetch_entry() const
Definition: ntuple:434
tools::rroot::branch_element::object
iro * object()
Definition: branch_element:647
tools::rroot::ntuple::column_element_ref::m_file
ifile & m_file
Definition: ntuple:445
tools::rroot::ntuple::column_element_ref::m_leaf
leaf_element & m_leaf
Definition: ntuple:447
tools::rroot::ntuple::column_element_ref::m_ref
T & m_ref
Definition: ntuple:449
tools::rroot::ntuple::column_element_ref::m_be
branch_element & m_be
Definition: ntuple:446
tools::uint32
unsigned int uint32
Definition: typedefs:71