g4tools  5.4.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::rcsv::ntuple::column< T > Class Template Reference
Inheritance diagram for tools::rcsv::ntuple::column< T >:
Inheritance graph
[legend]
Collaboration diagram for tools::rcsv::ntuple::column< 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 (const std::string &a_name, T *a_user_var=0)
 
virtual ~column ()
 
void set_value (const T &a_v)
 
- 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 (const column &a_from)
 
columnoperator= (const column &a_from)
 

Protected Attributes

std::string m_name
 
m_tmp
 
T * m_user_var
 

Additional Inherited Members

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

Detailed Description

template<class T>
class tools::rcsv::ntuple::column< T >

Definition at line 98 of file rcsv_ntuple.

Constructor & Destructor Documentation

◆ column() [1/2]

template<class T >
tools::rcsv::ntuple::column< T >::column ( const std::string &  a_name,
T *  a_user_var = 0 
)
inline

Definition at line 123 of file rcsv_ntuple.

124  :m_name(a_name)
125  ,m_tmp(T())
126  ,m_user_var(a_user_var) //not owner
127  {}

◆ ~column()

template<class T >
virtual tools::rcsv::ntuple::column< T >::~column ( )
inlinevirtual

Definition at line 128 of file rcsv_ntuple.

128 {}

◆ column() [2/2]

template<class T >
tools::rcsv::ntuple::column< T >::column ( const column< T > &  a_from)
inlineprotected

Definition at line 130 of file rcsv_ntuple.

131  :read::icol(a_from)
132  ,parent(a_from)
133  ,m_name(a_from.m_name)
134  ,m_tmp(a_from.m_tmp)
135  ,m_user_var(a_from.m_user_var)
136  {}

Member Function Documentation

◆ cast()

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

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

Definition at line 106 of file rcsv_ntuple.

106  {
107  if(void* p = cmp_cast<column>(this,a_class)) {return p;}
108  return parent::cast(a_class);
109  }

◆ fetch_entry()

template<class T >
virtual bool tools::rcsv::ntuple::column< T >::fetch_entry ( ) const
inlinevirtual

Reimplemented from tools::read::icol.

Definition at line 113 of file rcsv_ntuple.

113  {
114  if(m_user_var) *m_user_var = m_tmp;
115  return true;
116  }

◆ get_entry()

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

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

Definition at line 118 of file rcsv_ntuple.

118  {
119  a_v = m_tmp;
120  return true;
121  }

◆ id_class()

template<class T >
static cid tools::rcsv::ntuple::column< T >::id_class ( )
inlinestatic

Definition at line 101 of file rcsv_ntuple.

101  {
102  static const T s_v = T(); //do that for T = std::string.
103  return 200+_cid(s_v);
104  }

◆ id_cls()

template<class T >
virtual cid tools::rcsv::ntuple::column< T >::id_cls ( ) const
inlinevirtual

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

Definition at line 110 of file rcsv_ntuple.

110 {return id_class();}

◆ name()

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

Implements tools::read::icol.

Definition at line 112 of file rcsv_ntuple.

112 {return m_name;}

◆ operator=()

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

Definition at line 137 of file rcsv_ntuple.

137  {
138  m_name = a_from.m_name;
139  m_tmp = a_from.m_tmp;
140  m_user_var = a_from.m_user_var;
141  return *this;
142  }

◆ set_value()

template<class T >
void tools::rcsv::ntuple::column< T >::set_value ( const T &  a_v)
inline

Definition at line 145 of file rcsv_ntuple.

145 {m_tmp = a_v;}

Member Data Documentation

◆ m_name

template<class T >
std::string tools::rcsv::ntuple::column< T >::m_name
protected

Definition at line 147 of file rcsv_ntuple.

◆ m_tmp

template<class T >
T tools::rcsv::ntuple::column< T >::m_tmp
protected

Definition at line 148 of file rcsv_ntuple.

◆ m_user_var

template<class T >
T* tools::rcsv::ntuple::column< T >::m_user_var
protected

Definition at line 149 of file rcsv_ntuple.


The documentation for this class was generated from the following file:
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::rcsv::ntuple::column::m_user_var
T * m_user_var
Definition: rcsv_ntuple:149
tools::rcsv::ntuple::column::m_name
std::string m_name
Definition: rcsv_ntuple:147
tools::read::icolumn::cast
virtual void * cast(cid a_class) const
Definition: rntuple:44
tools::rcsv::ntuple::column::id_class
static cid id_class()
Definition: rcsv_ntuple:101
tools::rcsv::ntuple::column::m_tmp
T m_tmp
Definition: rcsv_ntuple:148