1 #ifndef GAUDI_NTUPLESVC_NTUPLEITEMS_H
2 #define GAUDI_NTUPLESVC_NTUPLEITEMS_H 1
5 #define ALLOW_ALL_TYPES
38 template <
class TYP>
class _DataImp :
virtual public _Data<TYP> {
67 : m_length(len), m_tuple(tup), m_name(
std::move(name)), m_index(
std::move(index)),
68 m_def(
std::move(def)), m_range(
std::move(low),
std::move(high)), m_info(info)
91 for (
int l = 0;
l < nd-1;
l++ ) {
95 long *ll = (
long*)m_indexItem->
buffer();
106 if ( !m_indexItem ) m_indexItem = m_tuple->
find(m_index);
111 if ( !m_indexItem ) m_indexItem = m_tuple->
find(m_index);
117 long size()
const override {
return m_length*
sizeof(TYP); }
141 long ndim()
const override {
return 0; }
143 long dim(
long i)
const override {
return (i==0) ? 1 : 0; }
150 template <
class TYP>
class _ItemImp :
virtual public _DataImp<TYP>,
151 virtual public _Item<TYP> {
158 :
_DataImp<TYP>(tup, name, info,
"", 1, min, max, def) { }
173 template <
class TYP>
class _ArrayImp :
virtual public _DataImp<TYP>,
174 virtual public _Array<TYP> {
180 :
_DataImp<TYP>(tup, name, typ, index, len, min, max, def) { }
192 long ndim()
const override {
return 1; }
194 long dim(
long i)
const override {
201 template <
class TYP>
class _MatrixImp :
virtual public _DataImp<TYP>,
202 virtual public _Matrix<TYP> {
208 long ncol,
long nrow,TYP min,TYP max,TYP def)
209 :
_DataImp<TYP>(tup, name, typ, index, nrow*ncol, min, max, def) {
223 long ndim()
const override {
return 2; }
225 long dim(
long i)
const override {
232 #endif // GAUDI_NTUPLESVC_NTUPLEITEMS_H
_DataImp(const _DataImp &)=delete
Inhibit Copy Constructor.
long type() const override
TYP information of the item.
~_DataImp() override
Standard destructor.
~_ArrayImp() override=default
Standard Destructor.
long filled() const override
Number of items filled.
const std::string & name() const override
Access _Column name.
_ArrayImp(INTuple *tup, const std::string &name, const std::type_info &typ, const std::string &index, long len, TYP min, TYP max, TYP def)
Standard Constructor.
long size() const override
Size of entire object.
~_ItemImp() override=default
Standard Destructor.
~_MatrixImp() override=default
Standard Destructor.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
static Type ID(const bool)
Access to type information: bool.
const ItemRange & range() const override
Access the range if specified.
Concrete class discribing a matrix column in a N tuple.
long size() const override
Size of entire object.
long ndim() const override
Dimension.
DataTypeInfo::Type m_type
_Column type
INTupleItem * indexItem() override
Pointer to index column (if present, 0 else)
TYP m_def
Buffer with default value.
Range< TYP > m_range
Check that values are within a certain range while filling.
_MatrixImp(INTuple *tup, const std::string &name, const std::type_info &typ, const std::string &index, long ncol, long nrow, TYP min, TYP max, TYP def)
Standard Constructor.
_DataImp(INTuple *tup, std::string name, const std::type_info &info, std::string index, long len, TYP low, TYP high, TYP def)
Standard Constructor.
const std::string & index() const override
Access the index _Column.
Data provider interface definition.
const void * buffer() const override
Access data buffer (CONST)
virtual void * buffer()
Access data buffer.
long ndim() const override
Dimension.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
NTuple interface class definition.
std::string m_index
Check that values are within a certain range while filling.
bool hasIndex() const override
Is the tuple have an index column?
NTuple interface class definition.
void reset() override
Reset to default.
long length() const override
Access the buffer length.
void setDefault(const TYP val) override
Set default value.
void setDefault(const TYP val) override
Compiler type ID.
Concrete class discribing a column-array in a N tuple.
long ndim() const override
Dimension.
long dim(long i) const override
Access individual dimensions.
long size() const override
Size of entire object.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
const ItemRange & range() const override
Access the range if specified.
long size() const override
Size of entire object.
Abstract class describing basic data in an Ntuple.
void release() override
Destruct object.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
long m_length
Entire buffer length.
std::string typeName() const override
Get proper type name.
INTuple * m_tuple
Pointer to N tuple.
Concrete class discribing a column in a N tuple.
long dim(long i) const override
Access individual dimensions.
const ItemRange & range() const override
Access the range if specified.
const std::type_info & m_info
Item type information.
const std::type_info & typeID() const override
Compiler type ID.
const INTupleItem * indexItem() const override
Pointer to index column (if present, 0 else) (CONST)
long m_rows
Number of rows per column.
Concrete class discribing basic data items in an N tuple.
TYP * m_buffer
Pointer to data buffer.
std::string m_name
_Column name
INTuple * tuple() override
Access to hosting ntuple.
long dim(long i) const override
Access individual dimensions.
void setDefault(const TYP val) override
Compiler type ID.
void setType(long t) override
Set the properties of the _Column.
_ItemImp(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Standard Constructor.
const ItemRange & range() const override
Access the range if specified.
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.
void setDefault(const TYP val) override
Compiler type ID.
virtual const void * buffer() const =0
Access data buffer (CONST)
const std::type_info & CTYPE