The Gaudi Framework  master (1304469f)
Loading...
Searching...
No Matches
NTuple::_Matrix< TYP > Class Template Reference

Abstract class describing a matrix column in a N tuple. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/NTuple.h>

Inheritance diagram for NTuple::_Matrix< TYP >:
Collaboration diagram for NTuple::_Matrix< TYP >:

Public Member Functions

template<class T>
_Matrix< TYP > & operator= (const _Matrix< T > &copy)
 Assignment operator.
 
TYP * column (long i)
 Access to data by reference.
 
const TYP * column (long i) const
 Access to data by reference (CONST)
 
- Public Member Functions inherited from NTuple::_Data< TYP >
virtual void setDefault (const TYP d)=0
 Set default value.
 
virtual const ItemRangerange () const =0
 Access the range if specified.
 
- Public Member Functions inherited from INTupleItem
virtual ~INTupleItem ()=default
 destructor
 
virtual void release ()=0
 Destruct object.
 
virtual const std::type_info & typeID () const =0
 Compiler type ID.
 
virtual std::string typeName () const =0
 Proper type name of the object.
 
virtual const void * buffer () const =0
 Access data buffer (CONST)
 
virtual bool hasIndex () const =0
 Is the tuple have an index item?
 
virtual const std::string & index () const =0
 Access the index _Item.
 
virtual const std::string & name () const =0
 Access _Item name.
 
virtual long type () const =0
 Type information of the item.
 
virtual long length () const =0
 Access the buffer length.
 
virtual void reset ()=0
 Reset column.
 
virtual long ndim () const =0
 Dimension.
 
virtual long dim (long i) const =0
 Access individual dimensions.
 
virtual long size () const =0
 Size of entire object.
 
virtual long filled () const =0
 Number of items filled.
 
virtual INTupleItemindexItem ()=0
 Pointer to index column (if present, 0 else)
 
virtual const INTupleItemindexItem () const =0
 Pointer to index column (if present, 0 else) (CONST)
 
virtual INTupletuple ()=0
 NTuple the item belongs to.
 

Static Public Member Functions

static _Matrixcreate (INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long ncol, long nrow, TYP min, TYP max, TYP def)
 Create instance.
 

Protected Attributes

long m_rows
 Number of rows per column.
 
- Protected Attributes inherited from NTuple::_Data< TYP >
TYP * m_buffer = nullptr
 Pointer to data buffer.
 

Additional Inherited Members

- Public Types inherited from NTuple::_Data< TYP >
typedef Range< TYP > ItemRange
 Set type definition to make life more easy easy.
 
- Protected Member Functions inherited from INTupleItem
virtual void setType (long typ)=0
 Set the properties of the INTupleItem.
 

Detailed Description

template<class TYP>
class NTuple::_Matrix< TYP >

Abstract class describing a matrix column in a N tuple.

Definition at line 188 of file NTuple.h.

Member Function Documentation

◆ column() [1/2]

template<class TYP>
TYP * NTuple::_Matrix< TYP >::column ( long i)
inline

Access to data by reference.

Definition at line 210 of file NTuple.h.

210{ return this->m_buffer + i * m_rows; }
TYP * m_buffer
Pointer to data buffer.
Definition NTuple.h:125
Abstract class describing a matrix column in a N tuple.
Definition NTuple.h:188
long m_rows
Number of rows per column.
Definition NTuple.h:191

◆ column() [2/2]

template<class TYP>
const TYP * NTuple::_Matrix< TYP >::column ( long i) const
inline

Access to data by reference (CONST)

Definition at line 212 of file NTuple.h.

212{ return this->m_buffer + i * m_rows; }

◆ create()

template<class TYP>
NTuple::_Matrix< TYP > * NTuple::_Matrix< TYP >::create ( INTuple * tup,
const std::string & name,
const std::type_info & info,
const std::string & index,
long ncol,
long nrow,
TYP min,
TYP max,
TYP def )
static

Create instance.

Definition at line 34 of file NTupleItems.cpp.

36 {
37 return new _MatrixImp<TYP>( tup, name, info, idx, ncol, nrow, min, max, def );
38}
virtual const std::string & name() const =0
Access _Item name.

◆ operator=()

template<class TYP>
template<class T>
_Matrix< TYP > & NTuple::_Matrix< TYP >::operator= ( const _Matrix< T > & copy)
inline

Assignment operator.

Definition at line 199 of file NTuple.h.

199 {
200 long len = this->length();
201 if ( len == copy.length() ) {
202 const T* source = (const T*)copy.buffer();
203 std::copy_n( source, len, this->m_buffer );
204 return *this;
205 }
206 throw std::out_of_range( "N-tuple matrix cannot be copied! The index range does not match!" );
207 return *this;
208 }
virtual const void * buffer() const =0
Access data buffer (CONST)
virtual long length() const =0
Access the buffer length.

Member Data Documentation

◆ m_rows

template<class TYP>
long NTuple::_Matrix< TYP >::m_rows
protected

Number of rows per column.

Definition at line 191 of file NTuple.h.


The documentation for this class was generated from the following files: