The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
NTuple::_DataImp< TYP > Class Template Reference

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

#include </builds/gaudi/Gaudi/GaudiKernel/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.
 
- Public Types inherited from NTuple::_Data< TYP >
typedef Range< TYP > ItemRange
 Set type definition to make life more easy easy.
 

Public Member Functions

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

Protected Types

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

Protected Attributes

long m_length
 Entire buffer length.
 
INTuplem_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.
 
INTupleItemm_indexItem = nullptr
 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.
 
- Protected Attributes inherited from NTuple::_Data< TYP >
TYP * m_buffer = nullptr
 Pointer to data buffer.
 

Private Member Functions

 _DataImp (const _DataImp &)=delete
 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 54 of file NTupleItems.h.

Member Typedef Documentation

◆ CSTR

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

Definition at line 59 of file NTupleItems.h.

◆ CTYPE

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

Definition at line 60 of file NTupleItems.h.

◆ ItemRange

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

Set type definition to make life more easy easy.

Definition at line 82 of file NTupleItems.h.

Constructor & Destructor Documentation

◆ _DataImp() [1/2]

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

Inhibit Copy Constructor.

◆ _DataImp() [2/2]

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

Standard Constructor.

Definition at line 84 of file NTupleItems.h.

86 : m_length( len )
87 , m_tuple( tup )
88 , m_name( std::move( name ) )
89 , m_index( std::move( index ) )
90 , m_def( std::move( def ) )
92 , m_info( info ) {
93 m_type = typeid( TYP ) == typeid( void* ) ? DataTypeInfo::POINTER : DataTypeInfo::ID( info );
94 this->m_buffer = new TYP[m_length];
95 reset();
96 }
static Type ID(const bool)
Access to type information: bool.
TYP * m_buffer
Pointer to data buffer.
Definition NTuple.h:125
Concrete class discribing basic data items in an N tuple.
Definition NTupleItems.h:54
const std::type_info & m_info
Item type information.
Definition NTupleItems.h:78
Range< TYP > m_range
Check that values are within a certain range while filling.
Definition NTupleItems.h:76
const std::string & index() const override
Access the index _Column.
std::string m_name
_Column name
Definition NTupleItems.h:66
TYP m_def
Buffer with default value.
Definition NTupleItems.h:74
const std::string & name() const override
Access _Column name.
INTuple * m_tuple
Pointer to N tuple.
Definition NTupleItems.h:64
void reset() override
Reset to default.
std::string m_index
Check that values are within a certain range while filling.
Definition NTupleItems.h:68
DataTypeInfo::Type m_type
_Column type
Definition NTupleItems.h:72
long m_length
Entire buffer length.
Definition NTupleItems.h:62

◆ ~_DataImp()

template<class TYP>
NTuple::_DataImp< TYP >::~_DataImp ( )
inlineoverride

Standard destructor.

Definition at line 98 of file NTupleItems.h.

98{ delete[] this->m_buffer; }

Member Function Documentation

◆ buffer() [1/2]

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

Access data buffer.

Definition at line 153 of file NTupleItems.h.

153{ return this->m_buffer; }

◆ buffer() [2/2]

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

Access data buffer (CONST)

Implements INTupleItem.

Definition at line 151 of file NTupleItems.h.

151{ return this->m_buffer; }

◆ dim()

template<class TYP>
long NTuple::_DataImp< TYP >::dim ( long i) const
inlineoverridevirtual

Access individual dimensions.

Implements INTupleItem.

Reimplemented in NTuple::_MatrixImp< TYP >.

Definition at line 157 of file NTupleItems.h.

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

◆ filled()

template<class TYP>
long NTuple::_DataImp< TYP >::filled ( ) const
inlineoverridevirtual

Number of items filled.

Implements INTupleItem.

Definition at line 104 of file NTupleItems.h.

104 {
105 long len = 1;
106 long nd = ndim();
107 if ( m_length > 1 ) {
108 for ( int l = 0; l < nd - 1; l++ ) { len *= dim( l ); }
109 if ( indexItem() ) {
110 long* ll = (long*)m_indexItem->buffer();
111 len *= *ll;
112 } else if ( nd > 0 ) {
113 len *= dim( nd - 1 );
114 }
115 }
116 return len;
117 }
INTupleItem * m_indexItem
Pointer to index item.
Definition NTupleItems.h:70
long ndim() const override
Dimension.
long dim(long i) const override
Access individual dimensions.
INTupleItem * indexItem() override
Pointer to index column (if present, 0 else)

◆ hasIndex()

template<class TYP>
bool NTuple::_DataImp< TYP >::hasIndex ( ) const
inlineoverridevirtual

Is the tuple have an index column?

Implements INTupleItem.

Definition at line 135 of file NTupleItems.h.

135{ return m_index.length() > 0; }

◆ index()

template<class TYP>
const std::string & NTuple::_DataImp< TYP >::index ( ) const
inlineoverridevirtual

Access the index _Column.

Implements INTupleItem.

Definition at line 137 of file NTupleItems.h.

137{ return m_index; }

◆ indexItem() [1/2]

template<class TYP>
const INTupleItem * NTuple::_DataImp< TYP >::indexItem ( ) const
inlineoverridevirtual

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

Implements INTupleItem.

Definition at line 124 of file NTupleItems.h.

124 {
125 if ( !m_indexItem ) m_indexItem = m_tuple->find( m_index );
126 return m_indexItem;
127 }

◆ indexItem() [2/2]

template<class TYP>
INTupleItem * NTuple::_DataImp< TYP >::indexItem ( )
inlineoverridevirtual

Pointer to index column (if present, 0 else)

Implements INTupleItem.

Definition at line 119 of file NTupleItems.h.

119 {
120 if ( !m_indexItem ) m_indexItem = m_tuple->find( m_index );
121 return m_indexItem;
122 }

◆ length()

template<class TYP>
long NTuple::_DataImp< TYP >::length ( ) const
inlineoverridevirtual

Access the buffer length.

Implements INTupleItem.

Definition at line 149 of file NTupleItems.h.

149{ return m_length; }

◆ name()

template<class TYP>
const std::string & NTuple::_DataImp< TYP >::name ( ) const
inlineoverridevirtual

Access _Column name.

Implements INTupleItem.

Definition at line 139 of file NTupleItems.h.

139{ return m_name; }

◆ ndim()

template<class TYP>
long NTuple::_DataImp< TYP >::ndim ( ) const
inlineoverridevirtual

Dimension.

Implements INTupleItem.

Reimplemented in NTuple::_MatrixImp< TYP >.

Definition at line 155 of file NTupleItems.h.

155{ return 0; }

◆ range()

template<class TYP>
const ItemRange & NTuple::_DataImp< TYP >::range ( ) const
inlineoverridevirtual

Access the range if specified.

Implements NTuple::_Data< TYP >.

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

Definition at line 147 of file NTupleItems.h.

147{ return m_range; }

◆ release()

template<class TYP>
void NTuple::_DataImp< TYP >::release ( )
inlineoverridevirtual

Destruct object.

Implements INTupleItem.

Definition at line 133 of file NTupleItems.h.

133{ delete this; }

◆ reset()

template<class TYP>
void NTuple::_DataImp< TYP >::reset ( )
inlineoverridevirtual

Reset to default.

Implements INTupleItem.

Definition at line 102 of file NTupleItems.h.

102{ std::fill_n( this->m_buffer, m_length, m_def ); }

◆ setDefault()

template<class TYP>
void NTuple::_DataImp< TYP >::setDefault ( const TYP val)
inlineoverridevirtual

Set default value.

Implements NTuple::_Data< TYP >.

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

Definition at line 145 of file NTupleItems.h.

145{ m_def = val; }

◆ setType()

template<class TYP>
void NTuple::_DataImp< TYP >::setType ( long t)
inlineoverridevirtual

Set the properties of the _Column.

Implements INTupleItem.

Definition at line 143 of file NTupleItems.h.

◆ size()

template<class TYP>
long NTuple::_DataImp< TYP >::size ( ) const
inlineoverridevirtual

Size of entire object.

Implements INTupleItem.

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

Definition at line 131 of file NTupleItems.h.

131{ return m_length * sizeof( TYP ); }

◆ tuple()

template<class TYP>
INTuple * NTuple::_DataImp< TYP >::tuple ( )
inlineoverridevirtual

Access to hosting ntuple.

Implements INTupleItem.

Definition at line 159 of file NTupleItems.h.

159{ return m_tuple; }

◆ type()

template<class TYP>
long NTuple::_DataImp< TYP >::type ( ) const
inlineoverridevirtual

TYP information of the item.

Implements INTupleItem.

Definition at line 141 of file NTupleItems.h.

141{ return m_type; }

◆ typeID()

template<class TYP>
const std::type_info & NTuple::_DataImp< TYP >::typeID ( ) const
inlineoverridevirtual

Compiler type ID.

Implements INTupleItem.

Definition at line 129 of file NTupleItems.h.

129{ return m_info; }

◆ typeName()

template<class TYP>
std::string NTuple::_DataImp< TYP >::typeName ( ) const
inlineoverridevirtual

Get proper type name.

Implements INTupleItem.

Definition at line 100 of file NTupleItems.h.

100{ return System::typeinfoName( this->typeID() ); }
const std::type_info & typeID() const override
Compiler type ID.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition System.cpp:260

Member Data Documentation

◆ m_def

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

Buffer with default value.

Definition at line 74 of file NTupleItems.h.

◆ m_index

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

Check that values are within a certain range while filling.

Definition at line 68 of file NTupleItems.h.

◆ m_indexItem

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

Pointer to index item.

Definition at line 70 of file NTupleItems.h.

◆ m_info

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

Item type information.

Definition at line 78 of file NTupleItems.h.

◆ m_length

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

Entire buffer length.

Definition at line 62 of file NTupleItems.h.

◆ m_name

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

_Column name

Definition at line 66 of file NTupleItems.h.

◆ m_range

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

Check that values are within a certain range while filling.

Definition at line 76 of file NTupleItems.h.

◆ m_tuple

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

Pointer to N tuple.

Definition at line 64 of file NTupleItems.h.

◆ m_type

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

_Column type

Definition at line 72 of file NTupleItems.h.


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