All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NTuple::_DataImp< TYP > Class Template Reference

Concrete class discribing basic data items in an N tuple. More...

#include <GaudiKernel/NTupleItems.h>

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

Public Types

typedef Range< TYP > ItemRange
 Set type definition to make life more easy easy. More...
 
- Public Types inherited from NTuple::_Data< TYP >
typedef Range< TYP > ItemRange
 Set type definition to make life more easy easy. More...
 

Public Member Functions

 _DataImp (INTuple *tup, const std::string &name, const std::type_info &info, const std::string &index, long len, TYP low, TYP high, TYP def)
 Standard Constructor. More...
 
virtual ~_DataImp ()
 Standard destructor. More...
 
virtual std::string typeName () const
 Get proper type name. More...
 
virtual void reset ()
 Reset to default. More...
 
virtual long filled () const
 Number of items filled. More...
 
virtual INTupleItemindexItem ()
 Pointer to index column (if present, 0 else) More...
 
virtual const INTupleItemindexItem () const
 Pointer to index column (if present, 0 else) (CONST) More...
 
virtual const std::type_info & typeID () const
 Compiler type ID. More...
 
virtual long size () const
 Size of entire object. More...
 
virtual void release ()
 Destruct object. More...
 
virtual bool hasIndex () const
 Is the tuple have an index column? More...
 
virtual const std::string & index () const
 Access the index _Column. More...
 
virtual const std::string & name () const
 Access _Column name. More...
 
virtual long type () const
 TYP information of the item. More...
 
virtual void setType (long t)
 Set the properties of the _Column. More...
 
virtual void setDefault (const TYP val)
 Set default value. More...
 
virtual const ItemRangerange () const
 Access the range if specified. More...
 
virtual long length () const
 Access the buffer length. More...
 
virtual const void * buffer () const
 Access data buffer (CONST) More...
 
virtual void * buffer ()
 Access data buffer. More...
 
virtual long ndim () const
 Dimension. More...
 
virtual long dim (long i) const
 Access individual dimensions. More...
 
virtual INTupletuple ()
 Access to hosting ntuple. More...
 
- Public Member Functions inherited from INTupleItem
virtual ~INTupleItem ()
 destructor More...
 

Protected Types

typedef const std::string & CSTR
 
typedef const std::type_info & CTYPE
 

Protected Attributes

long m_length
 Entire buffer length. More...
 
INTuplem_tuple
 Pointer to N tuple. More...
 
std::string m_name
 _Column name More...
 
std::string m_index
 Check that values are within a certain range while filling. More...
 
INTupleItemm_indexItem
 Pointer to index item. More...
 
DataTypeInfo::Type m_type
 _Column type More...
 
TYP m_def
 Buffer with default value. More...
 
Range< TYP > m_range
 Check that values are within a certain range while filling. More...
 
const std::type_info & m_info
 Item type information. More...
 
- Protected Attributes inherited from NTuple::_Data< TYP >
TYP * m_buffer
 Pointer to data buffer. More...
 

Private Member Functions

 _DataImp (const _DataImp &)
 Inhibit Copy Constructor. More...
 

Additional Inherited Members

Detailed Description

template<class TYP>
class NTuple::_DataImp< TYP >

Concrete class discribing basic data items in an N tuple.

Definition at line 32 of file NTupleItems.h.

Member Typedef Documentation

template<class TYP >
typedef const std::string& NTuple::_DataImp< TYP >::CSTR
protected

Definition at line 44 of file NTupleItems.h.

template<class TYP >
typedef const std::type_info& NTuple::_DataImp< TYP >::CTYPE
protected

Definition at line 45 of file NTupleItems.h.

template<class TYP >
typedef Range<TYP> NTuple::_DataImp< TYP >::ItemRange

Set type definition to make life more easy easy.

Definition at line 66 of file NTupleItems.h.

Constructor & Destructor Documentation

template<class TYP >
NTuple::_DataImp< TYP >::_DataImp ( const _DataImp< TYP > &  )
inlineprivate

Inhibit Copy Constructor.

Definition at line 42 of file NTupleItems.h.

42 {}
template<class TYP >
NTuple::_DataImp< TYP >::_DataImp ( INTuple tup,
const std::string &  name,
const std::type_info &  info,
const std::string &  index,
long  len,
TYP  low,
TYP  high,
TYP  def 
)
inline

Standard Constructor.

Definition at line 68 of file NTupleItems.h.

69  : m_length(len), m_tuple(tup), m_name(name), m_index(index),
70  m_def(def), m_range(low, high), m_info(info)
71  {
72  m_indexItem = 0;
73  m_type = typeid(TYP) == typeid(void*) ? DataTypeInfo::POINTER : DataTypeInfo::ID(info);
74  this->m_buffer = new TYP[m_length];
75  reset();
76  }
static Type ID(const bool)
Access to type information: bool.
Definition: DataTypeInfo.h:33
DataTypeInfo::Type m_type
_Column type
Definition: NTupleItems.h:57
virtual const std::string & name() const
Access _Column name.
Definition: NTupleItems.h:135
TYP m_def
Buffer with default value.
Definition: NTupleItems.h:59
Range< TYP > m_range
Check that values are within a certain range while filling.
Definition: NTupleItems.h:61
std::string m_index
Check that values are within a certain range while filling.
Definition: NTupleItems.h:53
long m_length
Entire buffer length.
Definition: NTupleItems.h:47
INTuple * m_tuple
Pointer to N tuple.
Definition: NTupleItems.h:49
virtual const std::string & index() const
Access the index _Column.
Definition: NTupleItems.h:133
virtual void reset()
Reset to default.
Definition: NTupleItems.h:86
const std::type_info & m_info
Item type information.
Definition: NTupleItems.h:63
TYP * m_buffer
Pointer to data buffer.
Definition: NTuple.h:115
std::string m_name
_Column name
Definition: NTupleItems.h:51
INTupleItem * m_indexItem
Pointer to index item.
Definition: NTupleItems.h:55
template<class TYP >
virtual NTuple::_DataImp< TYP >::~_DataImp ( )
inlinevirtual

Standard destructor.

Definition at line 78 of file NTupleItems.h.

78  {
79  if ( 0 != this->m_buffer ) delete [] this->m_buffer;
80  }
TYP * m_buffer
Pointer to data buffer.
Definition: NTuple.h:115

Member Function Documentation

template<class TYP >
virtual const void* NTuple::_DataImp< TYP >::buffer ( ) const
inlinevirtual

Access data buffer (CONST)

Implements INTupleItem.

Definition at line 147 of file NTupleItems.h.

147 { return this->m_buffer; }
TYP * m_buffer
Pointer to data buffer.
Definition: NTuple.h:115
template<class TYP >
virtual void* NTuple::_DataImp< TYP >::buffer ( )
inlinevirtual

Access data buffer.

Definition at line 149 of file NTupleItems.h.

149 { return this->m_buffer; }
TYP * m_buffer
Pointer to data buffer.
Definition: NTuple.h:115
template<class TYP >
virtual long NTuple::_DataImp< TYP >::dim ( long  i) const
inlinevirtual

Access individual dimensions.

Implements INTupleItem.

Reimplemented in NTuple::_MatrixImp< TYP >, and NTuple::_ArrayImp< TYP >.

Definition at line 153 of file NTupleItems.h.

153 { return (i==0) ? 1 : 0; }
list i
Definition: ana.py:128
template<class TYP >
virtual long NTuple::_DataImp< TYP >::filled ( ) const
inlinevirtual

Number of items filled.

Implements INTupleItem.

Definition at line 93 of file NTupleItems.h.

93  {
94  int len = 1;
95  int nd = ndim();
96  if ( m_length > 1 ) {
97  for ( int l = 0; l < nd-1; l++ ) {
98  len *= dim(l);
99  }
100  if ( indexItem() ) {
101  long *ll = (long*)m_indexItem->buffer();
102  len *= *ll;
103  }
104  else if ( nd > 0 ) {
105  len *= dim(nd-1);
106  }
107  }
108  return len;
109  }
long m_length
Entire buffer length.
Definition: NTupleItems.h:47
dictionary l
Definition: gaudirun.py:365
virtual long ndim() const
Dimension.
Definition: NTupleItems.h:151
virtual INTupleItem * indexItem()
Pointer to index column (if present, 0 else)
Definition: NTupleItems.h:111
virtual long dim(long i) const
Access individual dimensions.
Definition: NTupleItems.h:153
INTupleItem * m_indexItem
Pointer to index item.
Definition: NTupleItems.h:55
virtual const void * buffer() const =0
Access data buffer (CONST)
template<class TYP >
virtual bool NTuple::_DataImp< TYP >::hasIndex ( ) const
inlinevirtual

Is the tuple have an index column?

Implements INTupleItem.

Definition at line 131 of file NTupleItems.h.

131 { return m_index.length()>0; }
std::string m_index
Check that values are within a certain range while filling.
Definition: NTupleItems.h:53
template<class TYP >
virtual const std::string& NTuple::_DataImp< TYP >::index ( ) const
inlinevirtual

Access the index _Column.

Implements INTupleItem.

Definition at line 133 of file NTupleItems.h.

133 { return m_index; }
std::string m_index
Check that values are within a certain range while filling.
Definition: NTupleItems.h:53
template<class TYP >
virtual INTupleItem* NTuple::_DataImp< TYP >::indexItem ( )
inlinevirtual

Pointer to index column (if present, 0 else)

Implements INTupleItem.

Definition at line 111 of file NTupleItems.h.

111  {
112  if ( 0 == m_indexItem ) {
114  }
115  return m_indexItem;
116  }
std::string m_index
Check that values are within a certain range while filling.
Definition: NTupleItems.h:53
INTuple * m_tuple
Pointer to N tuple.
Definition: NTupleItems.h:49
virtual const INTupleItem * find(const std::string &name) const =0
Find an item row of the Ntuple (CONST)
INTupleItem * m_indexItem
Pointer to index item.
Definition: NTupleItems.h:55
template<class TYP >
virtual const INTupleItem* NTuple::_DataImp< TYP >::indexItem ( ) const
inlinevirtual

Pointer to index column (if present, 0 else) (CONST)

Implements INTupleItem.

Definition at line 118 of file NTupleItems.h.

118  {
119  if ( 0 == m_indexItem ) {
121  }
122  return m_indexItem;
123  }
std::string m_index
Check that values are within a certain range while filling.
Definition: NTupleItems.h:53
INTuple * m_tuple
Pointer to N tuple.
Definition: NTupleItems.h:49
virtual const INTupleItem * find(const std::string &name) const =0
Find an item row of the Ntuple (CONST)
INTupleItem * m_indexItem
Pointer to index item.
Definition: NTupleItems.h:55
template<class TYP >
virtual long NTuple::_DataImp< TYP >::length ( ) const
inlinevirtual

Access the buffer length.

Implements INTupleItem.

Definition at line 145 of file NTupleItems.h.

145 { return m_length; }
long m_length
Entire buffer length.
Definition: NTupleItems.h:47
template<class TYP >
virtual const std::string& NTuple::_DataImp< TYP >::name ( ) const
inlinevirtual

Access _Column name.

Implements INTupleItem.

Definition at line 135 of file NTupleItems.h.

135 { return m_name; }
std::string m_name
_Column name
Definition: NTupleItems.h:51
template<class TYP >
virtual long NTuple::_DataImp< TYP >::ndim ( ) const
inlinevirtual

Dimension.

Implements INTupleItem.

Reimplemented in NTuple::_MatrixImp< TYP >, and NTuple::_ArrayImp< TYP >.

Definition at line 151 of file NTupleItems.h.

151 { return 0; }
template<class TYP >
virtual const ItemRange& NTuple::_DataImp< TYP >::range ( ) const
inlinevirtual

Access the range if specified.

Implements NTuple::_Data< TYP >.

Reimplemented in NTuple::_MatrixImp< TYP >, NTuple::_ArrayImp< TYP >, and NTuple::_ItemImp< TYP >.

Definition at line 143 of file NTupleItems.h.

143 { return m_range; }
Range< TYP > m_range
Check that values are within a certain range while filling.
Definition: NTupleItems.h:61
template<class TYP >
virtual void NTuple::_DataImp< TYP >::release ( )
inlinevirtual

Destruct object.

Implements INTupleItem.

Definition at line 129 of file NTupleItems.h.

129 { delete this; }
template<class TYP >
virtual void NTuple::_DataImp< TYP >::reset ( )
inlinevirtual

Reset to default.

Implements INTupleItem.

Definition at line 86 of file NTupleItems.h.

86  {
87  TYP* buff = this->m_buffer;
88  for ( size_t i = 0; i < static_cast<size_t>(m_length); i++ ) {
89  *buff++ = m_def;
90  }
91  }
TYP m_def
Buffer with default value.
Definition: NTupleItems.h:59
long m_length
Entire buffer length.
Definition: NTupleItems.h:47
TYP * m_buffer
Pointer to data buffer.
Definition: NTuple.h:115
list i
Definition: ana.py:128
template<class TYP >
virtual void NTuple::_DataImp< TYP >::setDefault ( const TYP  val)
inlinevirtual

Set default value.

Implements NTuple::_Data< TYP >.

Reimplemented in NTuple::_MatrixImp< TYP >, NTuple::_ArrayImp< TYP >, and NTuple::_ItemImp< TYP >.

Definition at line 141 of file NTupleItems.h.

141 { m_def = val; }
TYP m_def
Buffer with default value.
Definition: NTupleItems.h:59
template<class TYP >
virtual void NTuple::_DataImp< TYP >::setType ( long  t)
inlinevirtual

Set the properties of the _Column.

Implements INTupleItem.

Definition at line 139 of file NTupleItems.h.

DataTypeInfo::Type m_type
_Column type
Definition: NTupleItems.h:57
template<class TYP >
virtual long NTuple::_DataImp< TYP >::size ( ) const
inlinevirtual

Size of entire object.

Implements INTupleItem.

Reimplemented in NTuple::_MatrixImp< TYP >, NTuple::_ArrayImp< TYP >, and NTuple::_ItemImp< TYP >.

Definition at line 127 of file NTupleItems.h.

127 { return m_length*sizeof(TYP); }
long m_length
Entire buffer length.
Definition: NTupleItems.h:47
template<class TYP >
virtual INTuple* NTuple::_DataImp< TYP >::tuple ( )
inlinevirtual

Access to hosting ntuple.

Implements INTupleItem.

Definition at line 155 of file NTupleItems.h.

155 { return m_tuple; }
INTuple * m_tuple
Pointer to N tuple.
Definition: NTupleItems.h:49
template<class TYP >
virtual long NTuple::_DataImp< TYP >::type ( ) const
inlinevirtual

TYP information of the item.

Implements INTupleItem.

Definition at line 137 of file NTupleItems.h.

137 { return m_type; }
DataTypeInfo::Type m_type
_Column type
Definition: NTupleItems.h:57
template<class TYP >
virtual const std::type_info& NTuple::_DataImp< TYP >::typeID ( ) const
inlinevirtual

Compiler type ID.

Implements INTupleItem.

Definition at line 125 of file NTupleItems.h.

125 { return m_info;}
const std::type_info & m_info
Item type information.
Definition: NTupleItems.h:63
template<class TYP >
virtual std::string NTuple::_DataImp< TYP >::typeName ( ) const
inlinevirtual

Get proper type name.

Implements INTupleItem.

Definition at line 82 of file NTupleItems.h.

82  {
83  return System::typeinfoName( this->typeID() );
84  }
virtual const std::type_info & typeID() const
Compiler type ID.
Definition: NTupleItems.h:125
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298

Member Data Documentation

template<class TYP >
TYP NTuple::_DataImp< TYP >::m_def
protected

Buffer with default value.

Definition at line 59 of file NTupleItems.h.

template<class TYP >
std::string NTuple::_DataImp< TYP >::m_index
protected

Check that values are within a certain range while filling.

Definition at line 53 of file NTupleItems.h.

template<class TYP >
INTupleItem* NTuple::_DataImp< TYP >::m_indexItem
mutableprotected

Pointer to index item.

Definition at line 55 of file NTupleItems.h.

template<class TYP >
const std::type_info& NTuple::_DataImp< TYP >::m_info
protected

Item type information.

Definition at line 63 of file NTupleItems.h.

template<class TYP >
long NTuple::_DataImp< TYP >::m_length
protected

Entire buffer length.

Definition at line 47 of file NTupleItems.h.

template<class TYP >
std::string NTuple::_DataImp< TYP >::m_name
protected

_Column name

Definition at line 51 of file NTupleItems.h.

template<class TYP >
Range<TYP> NTuple::_DataImp< TYP >::m_range
protected

Check that values are within a certain range while filling.

Definition at line 61 of file NTupleItems.h.

template<class TYP >
INTuple* NTuple::_DataImp< TYP >::m_tuple
protected

Pointer to N tuple.

Definition at line 49 of file NTupleItems.h.

template<class TYP >
DataTypeInfo::Type NTuple::_DataImp< TYP >::m_type
protected

_Column type

Definition at line 57 of file NTupleItems.h.


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