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

Public Member Functions

virtual void * cast (cid a_class) const
 
virtual cid id_cls () const
 
virtual const std::string & store_cls () const
 
virtual bool stream (buffer &a_buffer) const
 
virtual bool fill_buffer (buffer &a_buffer) const
 
 leaf_std_vector_ref (std::ostream &a_out, const std::string &a_name, base_leaf &a_leaf_count, const std::vector< T > &a_ref)
 
virtual ~leaf_std_vector_ref ()
 
get_max () const
 
void set_max (const T &a_value)
 
const std::vector< T > & variable () const
 
std::vector< T > & variable ()
 
- Public Member Functions inherited from tools::wroot::base_leaf
 base_leaf (std::ostream &a_out, const std::string &a_name, const std::string &a_title)
 
virtual ~base_leaf ()
 
const std::string & name () const
 
void set_title (const std::string &a_value)
 
uint32 length () const
 
void set_length (uint32 a_value)
 
void set_is_range (bool a_value)
 
- Public Member Functions inherited from tools::wroot::ibo
virtual ~ibo ()
 

Static Public Member Functions

static cid id_class ()
 
- Static Public Member Functions inherited from tools::wroot::base_leaf
static cid id_class ()
 

Protected Member Functions

 leaf_std_vector_ref (const leaf_std_vector_ref &a_from)
 
leaf_std_vector_refoperator= (const leaf_std_vector_ref &)
 
- Protected Member Functions inherited from tools::wroot::base_leaf
 base_leaf (const base_leaf &a_from)
 
base_leafoperator= (const base_leaf &)
 

Protected Attributes

m_min
 
m_max
 
const std::vector< T > & m_ref
 
- Protected Attributes inherited from tools::wroot::base_leaf
std::ostream & m_out
 
std::string m_name
 
std::string m_title
 
uint32 m_length
 
uint32 m_length_type
 
ibom_leaf_count
 
bool m_is_range
 

Detailed Description

template<class T>
class tools::wroot::leaf_std_vector_ref< T >

Definition at line 213 of file leaf.

Constructor & Destructor Documentation

◆ leaf_std_vector_ref() [1/2]

template<class T >
tools::wroot::leaf_std_vector_ref< T >::leaf_std_vector_ref ( std::ostream &  a_out,
const std::string &  a_name,
base_leaf a_leaf_count,
const std::vector< T > &  a_ref 
)
inline

Definition at line 239 of file leaf.

241  :parent(a_out,a_name,a_name)
242  ,m_min(T()),m_max(T())
243  ,m_ref(a_ref)
244  {
245  parent::m_leaf_count = &a_leaf_count;
246  a_leaf_count.set_is_range(true);
247  m_length = 1;
248  m_length_type = sizeof(T);
249  }

◆ ~leaf_std_vector_ref()

template<class T >
virtual tools::wroot::leaf_std_vector_ref< T >::~leaf_std_vector_ref ( )
inlinevirtual

Definition at line 250 of file leaf.

250 {}

◆ leaf_std_vector_ref() [2/2]

template<class T >
tools::wroot::leaf_std_vector_ref< T >::leaf_std_vector_ref ( const leaf_std_vector_ref< T > &  a_from)
inlineprotected

Definition at line 252 of file leaf.

252 :ibo(a_from),parent(a_from),m_ref(a_from.m_ref){}

Member Function Documentation

◆ cast()

template<class T >
virtual void* tools::wroot::leaf_std_vector_ref< T >::cast ( cid  a_class) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 217 of file leaf.

217  {
218  if(void* p = cmp_cast<leaf_std_vector_ref>(this,a_class)) {return p;}
219  return parent::cast(a_class);
220  }

◆ fill_buffer()

template<class T >
virtual bool tools::wroot::leaf_std_vector_ref< T >::fill_buffer ( buffer a_buffer) const
inlinevirtual

Implements tools::wroot::base_leaf.

Definition at line 234 of file leaf.

234  {
235  if(!a_buffer.write_fast_array(vec_data(m_ref),uint32(m_ref.size()))) return false;
236  return true;
237  }

◆ get_max()

template<class T >
T tools::wroot::leaf_std_vector_ref< T >::get_max ( ) const
inline

Definition at line 255 of file leaf.

255 {return m_max;}

◆ id_class()

template<class T >
static cid tools::wroot::leaf_std_vector_ref< T >::id_class ( )
inlinestatic

Definition at line 216 of file leaf.

216 {return base_leaf_cid()+_cid(std::vector<T>())+10000;} //10000 same as in ntuple::column_ref.

◆ id_cls()

template<class T >
virtual cid tools::wroot::leaf_std_vector_ref< T >::id_cls ( ) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 221 of file leaf.

221 {return id_class();}

◆ operator=()

template<class T >
leaf_std_vector_ref& tools::wroot::leaf_std_vector_ref< T >::operator= ( const leaf_std_vector_ref< T > &  )
inlineprotected

Definition at line 253 of file leaf.

253 {return *this;}

◆ set_max()

template<class T >
void tools::wroot::leaf_std_vector_ref< T >::set_max ( const T &  a_value)
inline

Definition at line 256 of file leaf.

256 {m_max = a_value;}

◆ store_cls()

template<class T >
virtual const std::string& tools::wroot::leaf_std_vector_ref< T >::store_cls ( ) const
inlinevirtual

Implements tools::wroot::ibo.

Definition at line 223 of file leaf.

223 {return leaf_store_class(T());}

◆ stream()

template<class T >
virtual bool tools::wroot::leaf_std_vector_ref< T >::stream ( buffer a_buffer) const
inlinevirtual

Reimplemented from tools::wroot::base_leaf.

Definition at line 224 of file leaf.

224  {
225  unsigned int c;
226  if(!a_buffer.write_version(1,c)) return false;
227  if(!parent::stream(a_buffer)) return false;
228  if(!a_buffer.write(m_min)) return false;
229  if(!a_buffer.write(m_max)) return false;
230  if(!a_buffer.set_byte_count(c)) return false;
231  return true;
232  }

◆ variable() [1/2]

template<class T >
std::vector<T>& tools::wroot::leaf_std_vector_ref< T >::variable ( )
inline

Definition at line 259 of file leaf.

259 {return const_cast< std::vector<T>& >(m_ref);}

◆ variable() [2/2]

template<class T >
const std::vector<T>& tools::wroot::leaf_std_vector_ref< T >::variable ( ) const
inline

Definition at line 258 of file leaf.

258 {return m_ref;}

Member Data Documentation

◆ m_max

template<class T >
T tools::wroot::leaf_std_vector_ref< T >::m_max
protected

Definition at line 262 of file leaf.

◆ m_min

template<class T >
T tools::wroot::leaf_std_vector_ref< T >::m_min
protected

Definition at line 261 of file leaf.

◆ m_ref

template<class T >
const std::vector<T>& tools::wroot::leaf_std_vector_ref< T >::m_ref
protected

Definition at line 263 of file leaf.


The documentation for this class was generated from the following file:
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::vec_data
const T * vec_data(const std::vector< T > &a_vec)
Definition: vdata:18
tools::wroot::base_leaf_cid
cid base_leaf_cid()
Definition: cids:20
tools::wroot::leaf_std_vector_ref::m_ref
const std::vector< T > & m_ref
Definition: leaf:263
tools::wroot::base_leaf::cast
virtual void * cast(cid a_class) const
Definition: base_leaf:30
tools::wroot::leaf_std_vector_ref::id_class
static cid id_class()
Definition: leaf:216
tools::wroot::leaf_store_class
const std::string & leaf_store_class(char)
Definition: leaf:15
tools::wroot::leaf_std_vector_ref::m_max
T m_max
Definition: leaf:262
tools::wroot::base_leaf::m_length
uint32 m_length
Definition: base_leaf:105
tools::wroot::base_leaf::m_length_type
uint32 m_length_type
Definition: base_leaf:106
tools::wroot::leaf_std_vector_ref::m_min
T m_min
Definition: leaf:261
tools::wroot::base_leaf::stream
virtual bool stream(buffer &a_buffer) const
Definition: base_leaf:36
tools::uint32
unsigned int uint32
Definition: typedefs:71
tools::wroot::base_leaf::m_leaf_count
ibo * m_leaf_count
Definition: base_leaf:107