2 #ifndef GAUDI_NTUPLESVC_NTUPLEITEMS_H
3 #define GAUDI_NTUPLESVC_NTUPLEITEMS_H 1
6 #define ALLOW_ALL_TYPES
39 template <
class TYP>
class _DataImp :
virtual public _Data<TYP> {
44 typedef const std::string&
CSTR;
45 typedef const std::type_info&
CTYPE;
68 _DataImp(
INTuple* tup,
const std::string&
name,
const std::type_info& info,
const std::string&
index,
long len,TYP low,TYP high,TYP def)
88 for (
size_t i = 0; i < static_cast<size_t>(
m_length);
i++ ) {
97 for (
int l = 0;
l < nd-1;
l++ ) {
151 virtual long ndim()
const {
return 0; }
153 virtual long dim(
long i)
const {
return (i==0) ? 1 : 0; }
160 template <
class TYP>
class _ItemImp :
virtual public _DataImp<TYP>,
161 virtual public _Item<TYP> {
168 :
_DataImp<TYP>(tup, name, info,
"", 1, min, max, def) { }
183 template <
class TYP>
class _ArrayImp :
virtual public _DataImp<TYP>,
184 virtual public _Array<TYP> {
190 :
_DataImp<TYP>(tup, name, typ, index, len, min, max, def) { }
202 virtual long ndim()
const {
return 1; }
204 virtual long dim(
long i)
const {
211 template <
class TYP>
class _MatrixImp :
virtual public _DataImp<TYP>,
212 virtual public _Matrix<TYP> {
218 long ncol,
long nrow,TYP
min,TYP max,TYP def)
219 :
_DataImp<TYP>(tup, name, typ, index, nrow*ncol, min, max, def) {
233 virtual long ndim()
const {
return 2; }
235 virtual long dim(
long i)
const {
242 #endif // GAUDI_NTUPLESVC_NTUPLEITEMS_H
_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.
_DataImp(const _DataImp &)
Inhibit Copy Constructor.
virtual long size() const
Size of entire object.
virtual const std::type_info & typeID() const
Compiler type ID.
_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.
virtual void release()
Destruct object.
virtual ~_MatrixImp()
Standard Destructor.
virtual long ndim() const
Dimension.
virtual long ndim() const
Dimension.
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.
Concrete class discribing a matrix column in a N tuple.
DataTypeInfo::Type m_type
_Column type
virtual const std::string & name() const
Access _Column name.
virtual void setDefault(const TYP val)
Compiler type ID.
virtual long dim(long i) const
Access individual dimensions.
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.
virtual void setDefault(const TYP val)
Set default value.
Data provider interface definition.
virtual long dim(long i) const
Access individual dimensions.
virtual std::string typeName() const
Get proper type name.
virtual void * buffer()
Access data buffer.
virtual long size() const
Size of entire object.
virtual ~_DataImp()
Standard destructor.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
NTuple interface class definition.
virtual const INTupleItem * indexItem() const
Pointer to index column (if present, 0 else) (CONST)
std::string m_index
Check that values are within a certain range while filling.
virtual long filled() const
Number of items filled.
NTuple interface class definition.
virtual ~_ItemImp()
Standard Destructor.
virtual const ItemRange & range() const
Access the range if specified.
virtual long size() const
Size of entire object.
Concrete class discribing a column-array in a N tuple.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
virtual const void * buffer() const
Access data buffer (CONST)
virtual long length() const
Access the buffer length.
Abstract class describing basic data in an Ntuple.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
virtual const ItemRange & range() const
Access the range if specified.
long m_length
Entire buffer length.
virtual const ItemRange & range() const
Access the range if specified.
virtual INTuple * tuple()
Access to hosting ntuple.
INTuple * m_tuple
Pointer to N tuple.
virtual void setDefault(const TYP val)
Compiler type ID.
virtual void setType(long t)
Set the properties of the _Column.
Concrete class discribing a column in a N tuple.
virtual const std::string & index() const
Access the index _Column.
virtual long size() const
Size of entire object.
virtual long ndim() const
Dimension.
virtual void reset()
Reset to default.
const std::type_info & m_info
Item type information.
virtual long type() const
TYP information of the item.
virtual ~_ArrayImp()
Standard Destructor.
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
virtual INTupleItem * indexItem()
Pointer to index column (if present, 0 else)
virtual bool hasIndex() const
Is the tuple have an index column?
virtual long dim(long i) const
Access individual dimensions.
_ItemImp(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Standard Constructor.
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.
virtual const void * buffer() const =0
Access data buffer (CONST)
const std::type_info & CTYPE
virtual void setDefault(const TYP val)
Compiler type ID.
virtual const ItemRange & range() const
Access the range if specified.