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

Public Member Functions

virtual void * cast (tools::cid a_class) const
 
virtual tools::cid id_cls () const
 
virtual bool add ()
 
virtual bool fetch_entry ()
 
virtual void reset ()
 
virtual const std::string & name () const
 
virtual bool set_basket_size (size_t)
 
 column_string_ref (store &a_store, pages &a_pages, bool a_write, const std::string &a_name, size_t, std::string &a_ref)
 
virtual ~column_string_ref ()
 
- Public Member Functions inherited from tools::hdf5::ntuple::icol
virtual ~icol ()
 

Static Public Member Functions

static tools::cid id_class ()
 

Protected Member Functions

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

Protected Attributes

storem_store
 
pagesm_branch
 
bool m_write
 
std::string m_name
 
std::string & m_ref
 

Detailed Description

Definition at line 486 of file ntuple.

Constructor & Destructor Documentation

◆ column_string_ref() [1/2]

tools::hdf5::ntuple::column_string_ref::column_string_ref ( store a_store,
pages a_pages,
bool  a_write,
const std::string &  a_name,
size_t  ,
std::string &  a_ref 
)
inline

Definition at line 517 of file ntuple.

520  :m_store(a_store)
521  ,m_branch(a_pages)
522  ,m_write(a_write)
523  ,m_name(a_name)
524  ,m_ref(a_ref)
525  {
526 #ifdef TOOLS_MEM
527  tools::mem::increment(s_class().c_str());
528 #endif
529  }

◆ ~column_string_ref()

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

Definition at line 530 of file ntuple.

530  {
531 #ifdef TOOLS_MEM
532  tools::mem::decrement(s_class().c_str());
533 #endif
534  }

◆ column_string_ref() [2/2]

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

Definition at line 536 of file ntuple.

537  :icol(a_from)
538  ,m_store(a_from.m_store)
539  ,m_branch(a_from.m_branch)
540  ,m_write(a_from.m_write)
541  ,m_name(a_from.m_name)
542  ,m_ref(a_from.m_ref)
543  {}

Member Function Documentation

◆ add()

virtual bool tools::hdf5::ntuple::column_string_ref::add ( )
inlinevirtual

Implements tools::hdf5::ntuple::icol.

Definition at line 501 of file ntuple.

501  { //write.
502  if(!m_write) return false;
503  return m_branch.write_string(m_ref);
504  }

◆ cast()

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

Implements tools::hdf5::ntuple::icol.

Reimplemented in tools::hdf5::ntuple::column_string.

Definition at line 495 of file ntuple.

495  {
496  if(void* p = tools::cmp_cast<column_string_ref>(this,a_class)) {return p;}
497  else return 0;
498  }

◆ fetch_entry()

virtual bool tools::hdf5::ntuple::column_string_ref::fetch_entry ( )
inlinevirtual

Implements tools::hdf5::ntuple::icol.

Definition at line 505 of file ntuple.

505  { //read.
506  if(m_write) return false;
507  if(!m_branch.read_string(m_ref)) {
508  m_store.out() << "tools::hdf5::ntuple::column_string_ref:fetch_entry : read_page() failed." << std::endl;
509  return false;
510  }
511  return true;
512  }

◆ id_class()

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

Definition at line 491 of file ntuple.

491  {
492  static const std::string s_v;
493  return tools::_cid(s_v)+10000;
494  }

◆ id_cls()

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

Implements tools::hdf5::ntuple::icol.

Reimplemented in tools::hdf5::ntuple::column_string.

Definition at line 499 of file ntuple.

499 {return id_class();}

◆ name()

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

Implements tools::hdf5::ntuple::icol.

Definition at line 514 of file ntuple.

514 {return m_name;}

◆ operator=()

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

Definition at line 544 of file ntuple.

544  {
545  if(&a_from==this) return *this;
546  m_name = a_from.m_name;
547  return *this;
548  }

◆ reset()

virtual void tools::hdf5::ntuple::column_string_ref::reset ( )
inlinevirtual

Implements tools::hdf5::ntuple::icol.

Definition at line 513 of file ntuple.

513 {m_branch.reset_pos();}

◆ set_basket_size()

virtual bool tools::hdf5::ntuple::column_string_ref::set_basket_size ( size_t  )
inlinevirtual

Implements tools::hdf5::ntuple::icol.

Definition at line 515 of file ntuple.

515 {return true;}

Member Data Documentation

◆ m_branch

pages& tools::hdf5::ntuple::column_string_ref::m_branch
protected

Definition at line 551 of file ntuple.

◆ m_name

std::string tools::hdf5::ntuple::column_string_ref::m_name
protected

Definition at line 553 of file ntuple.

◆ m_ref

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

Definition at line 554 of file ntuple.

◆ m_store

store& tools::hdf5::ntuple::column_string_ref::m_store
protected

Definition at line 550 of file ntuple.

◆ m_write

bool tools::hdf5::ntuple::column_string_ref::m_write
protected

Definition at line 552 of file ntuple.


The documentation for this class was generated from the following file:
tools::hdf5::pages::read_string
bool read_string(std::string &a_string)
Definition: pages:215
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::hdf5::ntuple::column_string_ref::m_name
std::string m_name
Definition: ntuple:553
tools::hdf5::pages::reset_pos
void reset_pos()
Definition: pages:102
tools::hdf5::ntuple::column_string_ref::m_ref
std::string & m_ref
Definition: ntuple:554
tools::hdf5::ntuple::column_string_ref::m_store
store & m_store
Definition: ntuple:550
tools::hdf5::store::out
std::ostream & out() const
Definition: store:154
tools::hdf5::ntuple::column_string_ref::m_write
bool m_write
Definition: ntuple:552
tools::hdf5::pages::write_string
bool write_string(const std::string &a_string)
Definition: pages:193
tools::hdf5::ntuple::column_string_ref::m_branch
pages & m_branch
Definition: ntuple:551
tools::hdf5::ntuple::column_string_ref::id_class
static tools::cid id_class()
Definition: ntuple:491