g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rroot::ntuple::column_string_ref Class Reference
Inheritance diagram for tools::rroot::ntuple::column_string_ref:
Inheritance graph
[legend]
Collaboration diagram for tools::rroot::ntuple::column_string_ref:
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
 
 column_string_ref (ifile &a_file, branch &a_branch, leaf_string &a_leaf, int64 &a_index, std::string &a_ref)
 
virtual ~column_string_ref ()
 
bool get_entry (std::string &a_v) const
 
- Public Member Functions inherited from tools::read::icol
virtual ~icol ()
 
virtual void stop ()
 

Static Public Member Functions

static cid id_class ()
 

Protected Member Functions

 column_string_ref (const column_string_ref &a_from)
 
column_string_refoperator= (const column_string_ref &a_from)
 
bool _fetch_entry () const
 

Protected Attributes

ifilem_file
 
branchm_branch
 
leaf_stringm_leaf
 
int64m_index
 
std::string & m_ref
 

Detailed Description

Definition at line 149 of file ntuple.

Constructor & Destructor Documentation

◆ column_string_ref() [1/2]

tools::rroot::ntuple::column_string_ref::column_string_ref ( ifile a_file,
branch a_branch,
leaf_string a_leaf,
int64 a_index,
std::string &  a_ref 
)
inline

Definition at line 166 of file ntuple.

167  :m_file(a_file)
168  ,m_branch(a_branch)
169  ,m_leaf(a_leaf)
170  ,m_index(a_index) //WARNING : we keep the ref !
171  ,m_ref(a_ref)
172  {}

◆ ~column_string_ref()

virtual tools::rroot::ntuple::column_string_ref::~column_string_ref ( )
inlinevirtual

Definition at line 173 of file ntuple.

173 {}

◆ column_string_ref() [2/2]

tools::rroot::ntuple::column_string_ref::column_string_ref ( const column_string_ref a_from)
inlineprotected

Definition at line 175 of file ntuple.

176  :parent(a_from)
177  ,m_file(a_from.m_file)
178  ,m_branch(a_from.m_branch)
179  ,m_leaf(a_from.m_leaf)
180  ,m_index(a_from.m_index)
181  ,m_ref(a_from.m_ref)
182  {}

Member Function Documentation

◆ _fetch_entry()

bool tools::rroot::ntuple::column_string_ref::_fetch_entry ( ) const
inlineprotected

Definition at line 194 of file ntuple.

194  {
195  unsigned int n;
196  if(!m_branch.find_entry(m_file,uint32(m_index),n)) {m_ref.clear();return false;}
197  const char* _cs = m_leaf.value();
198  if(!_cs) {m_ref.clear();return false;}
199  m_ref = _cs;
200  return true;
201  }

◆ cast()

virtual void* tools::rroot::ntuple::column_string_ref::cast ( cid  a_class) const
inlinevirtual

Implements tools::read::icol.

Reimplemented in tools::rroot::ntuple::column_vector_string, tools::rroot::ntuple::column_vector_string_ref, and tools::rroot::ntuple::column_string.

Definition at line 157 of file ntuple.

157  {
158  if(void* p = cmp_cast<column_string_ref>(this,a_class)) return p;
159  return 0;
160  }

◆ fetch_entry()

virtual bool tools::rroot::ntuple::column_string_ref::fetch_entry ( ) const
inlinevirtual

Reimplemented from tools::read::icol.

Reimplemented in tools::rroot::ntuple::column_vector_string_ref.

Definition at line 164 of file ntuple.

164 {return _fetch_entry();}

◆ get_entry()

bool tools::rroot::ntuple::column_string_ref::get_entry ( std::string &  a_v) const
inline

Definition at line 188 of file ntuple.

188  {
189  if(!_fetch_entry()) {a_v.clear();return false;}
190  a_v = m_ref;
191  return true;
192  }

◆ id_class()

static cid tools::rroot::ntuple::column_string_ref::id_class ( )
inlinestatic

Definition at line 152 of file ntuple.

152  {
153  static const std::string s_v;
154  return _cid(s_v)+10000;
155  }

◆ id_cls()

virtual cid tools::rroot::ntuple::column_string_ref::id_cls ( ) const
inlinevirtual

◆ name()

virtual const std::string& tools::rroot::ntuple::column_string_ref::name ( ) const
inlinevirtual

◆ operator=()

column_string_ref& tools::rroot::ntuple::column_string_ref::operator= ( const column_string_ref a_from)
inlineprotected

Definition at line 183 of file ntuple.

183  {
184  if(&a_from==this) return *this;
185  return *this;
186  }

Member Data Documentation

◆ m_branch

branch& tools::rroot::ntuple::column_string_ref::m_branch
protected

Definition at line 204 of file ntuple.

◆ m_file

ifile& tools::rroot::ntuple::column_string_ref::m_file
protected

Definition at line 203 of file ntuple.

◆ m_index

int64& tools::rroot::ntuple::column_string_ref::m_index
protected

Definition at line 206 of file ntuple.

◆ m_leaf

leaf_string& tools::rroot::ntuple::column_string_ref::m_leaf
protected

Definition at line 205 of file ntuple.

◆ m_ref

std::string& tools::rroot::ntuple::column_string_ref::m_ref
protected

Definition at line 207 of file ntuple.


The documentation for this class was generated from the following file:
tools::rroot::ntuple::column_string_ref::m_index
int64 & m_index
Definition: ntuple:206
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::rroot::ntuple::column_string_ref::m_ref
std::string & m_ref
Definition: ntuple:207
tools::rroot::ntuple::column_string_ref::m_branch
branch & m_branch
Definition: ntuple:204
tools::rroot::ntuple::column_string_ref::_fetch_entry
bool _fetch_entry() const
Definition: ntuple:194
tools::rroot::base_leaf::name
const std::string & name() const
Definition: base_leaf:146
tools::rroot::ntuple::column_string_ref::id_class
static cid id_class()
Definition: ntuple:152
tools::rroot::leaf_string::value
const char * value() const
Definition: leaf:307
tools::rroot::branch::find_entry
virtual bool find_entry(ifile &a_file, uint64 a_entry, uint32 &a_nbytes)
Definition: branch:537
tools::rroot::ntuple::column_string_ref::m_file
ifile & m_file
Definition: ntuple:203
tools::rroot::ntuple::column_string_ref::m_leaf
leaf_string & m_leaf
Definition: ntuple:205
tools::uint32
unsigned int uint32
Definition: typedefs:71