g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rroot::ntuple::std_vector_column_ref< T > Class Template Reference
Inheritance diagram for tools::rroot::ntuple::std_vector_column_ref< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::ntuple::std_vector_column_ref< 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
 
 std_vector_column_ref (ifile &a_file, branch &a_branch, leaf< T > &a_leaf, int64 &a_index, std::vector< T > &a_ref)
 
virtual ~std_vector_column_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

 std_vector_column_ref (const std_vector_column_ref &a_from)
 
std_vector_column_refoperator= (const std_vector_column_ref &a_from)
 
bool _fetch_entry () const
 

Protected Attributes

ifilem_file
 
branchm_branch
 
leaf< T > & m_leaf
 
int64m_index
 
std::vector< T > & m_ref
 

Additional Inherited Members

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

Detailed Description

template<class T>
class tools::rroot::ntuple::std_vector_column_ref< T >

Definition at line 332 of file ntuple.

Constructor & Destructor Documentation

◆ std_vector_column_ref() [1/2]

template<class T >
tools::rroot::ntuple::std_vector_column_ref< T >::std_vector_column_ref ( ifile a_file,
branch a_branch,
leaf< T > &  a_leaf,
int64 a_index,
std::vector< T > &  a_ref 
)
inline

Definition at line 353 of file ntuple.

354  :m_file(a_file)
355  ,m_branch(a_branch)
356  ,m_leaf(a_leaf)
357  ,m_index(a_index) //WARNING : we keep the ref !
358  ,m_ref(a_ref)
359  {}

◆ ~std_vector_column_ref()

template<class T >
virtual tools::rroot::ntuple::std_vector_column_ref< T >::~std_vector_column_ref ( )
inlinevirtual

Definition at line 360 of file ntuple.

360 {}

◆ std_vector_column_ref() [2/2]

template<class T >
tools::rroot::ntuple::std_vector_column_ref< T >::std_vector_column_ref ( const std_vector_column_ref< T > &  a_from)
inlineprotected

Definition at line 362 of file ntuple.

363  :read::icol(a_from)
364  ,parent(a_from)
365  ,m_file(a_from.m_file)
366  ,m_branch(a_from.m_branch)
367  ,m_leaf(a_from.m_leaf)
368  ,m_index(a_from.m_index)
369  ,m_ref(a_from.m_ref)
370  {}

Member Function Documentation

◆ _fetch_entry()

template<class T >
bool tools::rroot::ntuple::std_vector_column_ref< T >::_fetch_entry ( ) const
inlineprotected

Definition at line 376 of file ntuple.

376  {
377  unsigned int n;
378  if(!m_branch.find_entry(m_file,uint32(m_index),n)) {m_ref.clear();return false;}
379  m_leaf.value(m_ref);
380  return true;
381  }

◆ cast()

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

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

Definition at line 337 of file ntuple.

337  {
338  if(void* p = cmp_cast<std_vector_column_ref>(this,a_class)) return p;
339  return parent::cast(a_class);
340  }

◆ fetch_entry()

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

Reimplemented from tools::read::icol.

Definition at line 345 of file ntuple.

345 {return _fetch_entry();}

◆ get_entry()

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

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

Definition at line 346 of file ntuple.

346  {
347  if(!_fetch_entry()) {a_v = T();return false;}
348  if(m_ref.empty()) {a_v = T();return false;}
349  a_v = m_ref[0];
350  return true;
351  }

◆ id_class()

template<class T >
static cid tools::rroot::ntuple::std_vector_column_ref< T >::id_class ( )
inlinestatic

Definition at line 335 of file ntuple.

335 {return 200+_cid(T())+10000;}

◆ id_cls()

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

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

Definition at line 341 of file ntuple.

341 {return id_class();}

◆ name()

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

Implements tools::read::icol.

Definition at line 343 of file ntuple.

343 {return m_leaf.name();}

◆ operator=()

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

Definition at line 371 of file ntuple.

371  {
372  if(&a_from==this) return *this;
373  return *this;
374  }

Member Data Documentation

◆ m_branch

template<class T >
branch& tools::rroot::ntuple::std_vector_column_ref< T >::m_branch
protected

Definition at line 384 of file ntuple.

◆ m_file

template<class T >
ifile& tools::rroot::ntuple::std_vector_column_ref< T >::m_file
protected

Definition at line 383 of file ntuple.

◆ m_index

template<class T >
int64& tools::rroot::ntuple::std_vector_column_ref< T >::m_index
protected

Definition at line 386 of file ntuple.

◆ m_leaf

template<class T >
leaf<T>& tools::rroot::ntuple::std_vector_column_ref< T >::m_leaf
protected

Definition at line 385 of file ntuple.

◆ m_ref

template<class T >
std::vector<T>& tools::rroot::ntuple::std_vector_column_ref< T >::m_ref
protected

Definition at line 387 of file ntuple.


The documentation for this class was generated from the following file:
tools::rroot::ntuple::std_vector_column_ref::m_leaf
leaf< T > & m_leaf
Definition: ntuple:385
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::rroot::ntuple::std_vector_column_ref::m_index
int64 & m_index
Definition: ntuple:386
tools::rroot::ntuple::std_vector_column_ref::m_ref
std::vector< T > & m_ref
Definition: ntuple:387
tools::rroot::ntuple::std_vector_column_ref::_fetch_entry
bool _fetch_entry() const
Definition: ntuple:376
tools::rroot::ntuple::std_vector_column_ref::m_file
ifile & m_file
Definition: ntuple:383
tools::rroot::ntuple::std_vector_column_ref::id_class
static cid id_class()
Definition: ntuple:335
tools::read::icolumn::cast
virtual void * cast(cid a_class) const
Definition: rntuple:44
tools::rroot::ntuple::std_vector_column_ref::m_branch
branch & m_branch
Definition: ntuple:384
tools::rroot::branch::find_entry
virtual bool find_entry(ifile &a_file, uint64 a_entry, uint32 &a_nbytes)
Definition: branch:537
tools::uint32
unsigned int uint32
Definition: typedefs:71