| # Gaudi Framework, version v23r0 |

Home |  | Generated: Mon Jan 30 2012

Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Member Functions

# NTuple::_DataImp< TYP > Class Template Reference

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

`#include <NTupleItems.h>`

Inheritance diagram for NTuple::_DataImp< TYP >:
[legend]
Collaboration diagram for NTuple::_DataImp< TYP >:
[legend]

List of all members.

## Public Types
typedef Range< TYP > | ItemRange
| Set type definition to make life more easy easy.
## 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.
virtual | ~_DataImp ()
| Standard destructor.
virtual std::string | typeName () const
| Get proper type name.
virtual void | reset ()
| Reset to default.
virtual long | filled () const
| Number of items filled.
virtual INTupleItem * | indexItem ()
| Pointer to index column (if present, 0 else)
virtual const INTupleItem * | indexItem () const
| Pointer to index column (if present, 0 else) (CONST)
virtual const std::type_info & | typeID () const
| Compiler type ID.
virtual long | size () const
| Size of entire object.
virtual void | release ()
| Destruct object.
virtual bool | hasIndex () const
| Is the tuple have an index column?
virtual const std::string & | index () const
| Access the index _Column.
virtual const std::string & | name () const
| Access _Column name.
virtual long | type () const
| TYP information of the item.
virtual void | setType (long t)
| Set the properties of the _Column.
virtual void | setDefault (const TYP val)
| Set default value.
virtual const ItemRange & | range () const
| Access the range if specified.
virtual long | length () const
| Access the buffer length.
virtual const void * | buffer () const
| Access data buffer (CONST)
virtual void * | buffer ()
| Access data buffer.
virtual long | ndim () const
| Dimension.
virtual long | dim (long i) const
| Access individual dimensions.
virtual INTuple * | tuple ()
| Access to hosting ntuple.
## Protected Types
typedef const std::string & | CSTR
typedef const std::type_info & | CTYPE
## Protected Attributes
long | m_length
| Entire buffer length.
INTuple * | m_tuple
| Pointer to N tuple.
std::string | m_name
| _Column name
std::string | m_index
| Check that values are within a certain range while filling.
INTupleItem * | m_indexItem
| Pointer to index item.
DataTypeInfo::Type | m_type
| _Column type
TYP | m_def
| Buffer with default value.
Range< TYP > | m_range
| Check that values are within a certain range while filling.
const std::type_info & | m_info
| Item type information.
## Private Member Functions
| _DataImp (const _DataImp &copy)
| Inhibit Copy Constructor.

## Detailed Description

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

Concrete class discribing basic data items in an N tuple.

Definition at line 39 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.

Reimplemented from NTuple::_Data< TYP >.

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

Definition at line 66 of file NTupleItems.h.

## Constructor & Destructor Documentation

template<class TYP >

NTuple::_DataImp< TYP >::_DataImp | ( | const _DataImp< TYP > & | copy ) | `[inline, private]`

Inhibit Copy Constructor.

Definition at line 42 of file NTupleItems.h.

    {}

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.

        : m_length(len), m_tuple(tup), m_name(name), m_index(index),
          m_def(def), m_range(low, high), m_info(info)
        {
          m_indexItem = 0;
          m_type = typeid(TYP) == typeid(void*) ? DataTypeInfo::POINTER : DataTypeInfo::ID(info);
          this->m_buffer = new TYP[m_length];
          reset();
        }

template<class TYP >

virtual NTuple::_DataImp< TYP >::~_DataImp | ( | ) | `[inline, virtual]`

Standard destructor.

Definition at line 78 of file NTupleItems.h.

                                                 {
          if ( 0 != this->m_buffer ) delete [] this->m_buffer;
        }

## Member Function Documentation

template<class TYP >

virtual const void* NTuple::_DataImp< TYP >::buffer | ( | ) | const`[inline, virtual]`

Access data buffer (CONST)

Implements INTupleItem.

Definition at line 147 of file NTupleItems.h.

    { return this->m_buffer; }

template<class TYP >

virtual void* NTuple::_DataImp< TYP >::buffer | ( | ) | `[inline, virtual]`

Access data buffer.

Definition at line 149 of file NTupleItems.h.

    { return this->m_buffer; }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::dim | ( | long | i ) | const`[inline, virtual]`

Access individual dimensions.

Implements INTupleItem.

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

Definition at line 153 of file NTupleItems.h.

    { return (i==0) ? 1 : 0; }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::filled | ( | ) | const`[inline, virtual]`

Number of items filled.

Implements INTupleItem.

Definition at line 93 of file NTupleItems.h.

                                                  {
          int len = 1;
          int nd = ndim();
          if ( m_length > 1 )   {
            for ( int l = 0; l < nd-1; l++ )   {
              len *= dim(l);
            }
            if ( indexItem() )   {
              long *ll = (long*)m_indexItem->buffer();
              len *= *ll;
            }
            else if ( nd > 0 )   {
              len *= dim(nd-1);
            }
          }
          return len;
        }

template<class TYP >

virtual bool NTuple::_DataImp< TYP >::hasIndex | ( | ) | const`[inline, virtual]`

Is the tuple have an index column?

Implements INTupleItem.

Definition at line 131 of file NTupleItems.h.

    { return m_index.length()>0; }

template<class TYP >

virtual const std::string& NTuple::_DataImp< TYP >::index | ( | ) | const`[inline, virtual]`

Access the index _Column.

Implements INTupleItem.

Definition at line 133 of file NTupleItems.h.

    { return m_index; }

template<class TYP >

virtual INTupleItem* NTuple::_DataImp< TYP >::indexItem | ( | ) | `[inline, virtual]`

Pointer to index column (if present, 0 else)

Implements INTupleItem.

Definition at line 111 of file NTupleItems.h.

                                                          {
          if ( 0 == m_indexItem )   {
            m_indexItem = m_tuple->find(m_index);
          }
          return m_indexItem;
        }

template<class TYP >

virtual const INTupleItem* NTuple::_DataImp< TYP >::indexItem | ( | ) | const`[inline, virtual]`

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

Implements INTupleItem.

Definition at line 118 of file NTupleItems.h.

                                                          {
          if ( 0 == m_indexItem )   {
            m_indexItem = m_tuple->find(m_index);
          }
          return m_indexItem;
        }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::length | ( | ) | const`[inline, virtual]`

Access the buffer length.

Implements INTupleItem.

Definition at line 145 of file NTupleItems.h.

    { return m_length; }

template<class TYP >

virtual const std::string& NTuple::_DataImp< TYP >::name | ( | ) | const`[inline, virtual]`

Access _Column name.

Implements INTupleItem.

Definition at line 135 of file NTupleItems.h.

    { return m_name; }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::ndim | ( | ) | const`[inline, virtual]`

Dimension.

Implements INTupleItem.

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

Definition at line 151 of file NTupleItems.h.

    { return 0; }

template<class TYP >

virtual const ItemRange& NTuple::_DataImp< TYP >::range | ( | ) | const`[inline, virtual]`

Access the range if specified.

Implements NTuple::_Data< TYP >.

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

Definition at line 143 of file NTupleItems.h.

    { return m_range; }

template<class TYP >

virtual void NTuple::_DataImp< TYP >::release | ( | ) | `[inline, virtual]`

Destruct object.

Implements INTupleItem.

Definition at line 129 of file NTupleItems.h.

    { delete this; }

template<class TYP >

virtual void NTuple::_DataImp< TYP >::reset | ( | ) | `[inline, virtual]`

Reset to default.

Implements INTupleItem.

Definition at line 86 of file NTupleItems.h.

                                                  {
          TYP* buff = this->m_buffer;
          for ( size_t i = 0; i < static_cast<size_t>(m_length); i++ )    {
            *buff++ = m_def;
          }
        }

template<class TYP >

virtual void NTuple::_DataImp< TYP >::setDefault | ( | const TYP | val ) | `[inline, virtual]`

Set default value.

Implements NTuple::_Data< TYP >.

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

Definition at line 141 of file NTupleItems.h.

    { m_def = val; }

template<class TYP >

virtual void NTuple::_DataImp< TYP >::setType | ( | long | t ) | `[inline, virtual]`

Set the properties of the _Column.

Implements INTupleItem.

Definition at line 139 of file NTupleItems.h.

    { m_type=DataTypeInfo::Type(t); }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::size | ( | void | ) | const`[inline, virtual]`

Size of entire object.

Implements INTupleItem.

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

Definition at line 127 of file NTupleItems.h.

    { return m_length*sizeof(TYP); }

template<class TYP >

virtual INTuple* NTuple::_DataImp< TYP >::tuple | ( | ) | `[inline, virtual]`

Access to hosting ntuple.

Implements INTupleItem.

Definition at line 155 of file NTupleItems.h.

    { return m_tuple; }

template<class TYP >

virtual long NTuple::_DataImp< TYP >::type | ( | ) | const`[inline, virtual]`

TYP information of the item.

Implements INTupleItem.

Definition at line 137 of file NTupleItems.h.

    { return m_type; }

template<class TYP >

virtual const std::type_info& NTuple::_DataImp< TYP >::typeID | ( | ) | const`[inline, virtual]`

Compiler type ID.

Implements INTupleItem.

Definition at line 125 of file NTupleItems.h.

    { return m_info;}

template<class TYP >

virtual std::string NTuple::_DataImp< TYP >::typeName | ( | ) | const`[inline, virtual]`

Get proper type name.

Implements INTupleItem.

Definition at line 82 of file NTupleItems.h.

                                               {
          return System::typeinfoName( this->typeID() );
        }

## 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`[mutable, protected]`

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:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v23r0/GaudiKernel/GaudiKernel/NTupleItems.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines