The Gaudi Framework  master (37c0b60a)
INTuple.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_INTUPLE_H
12 #define GAUDIKERNEL_INTUPLE_H
13 
14 // STL include files
15 #include <string>
16 #include <typeinfo>
17 #include <vector>
18 
19 // Framework include files
20 #include <GaudiKernel/Kernel.h>
21 #include <GaudiKernel/StatusCode.h>
22 
23 // Forward declarations
24 class INTuple;
25 class INTupleItem;
26 class ISelectStatement;
27 
38 protected:
40  virtual void setType( long typ ) = 0;
41 
42 public:
44  virtual ~INTupleItem() = default;
45 
47  virtual void release() = 0;
49  virtual const std::type_info& typeID() const = 0;
51  virtual std::string typeName() const = 0;
53  virtual const void* buffer() const = 0;
55  virtual bool hasIndex() const = 0;
57  virtual const std::string& index() const = 0;
59  virtual const std::string& name() const = 0;
61  virtual long type() const = 0;
63  virtual long length() const = 0;
65  virtual void reset() = 0;
67  virtual long ndim() const = 0;
69  virtual long dim( long i ) const = 0;
71  virtual long size() const = 0;
73  virtual long filled() const = 0;
75  virtual INTupleItem* indexItem() = 0;
77  virtual const INTupleItem* indexItem() const = 0;
79  virtual INTuple* tuple() = 0;
80 };
81 
92 protected:
94  virtual INTupleItem* i_find( const std::string& name ) const = 0;
95 
96 public:
97  // Definition of _Item container
100  virtual ItemContainer& items() = 0;
102  virtual const ItemContainer& items() const = 0;
104  virtual char* setBuffer( char* buff ) = 0;
106  virtual const char* buffer() const = 0;
108  virtual char* buffer() = 0;
110  virtual const std::string& title() const = 0;
112  virtual void reset() = 0;
114  virtual const INTupleItem* find( const std::string& name ) const = 0;
116  virtual INTupleItem* find( const std::string& name ) = 0;
118  virtual StatusCode add( INTupleItem* item ) = 0;
120  virtual StatusCode remove( INTupleItem* item ) = 0;
122  virtual StatusCode remove( const std::string& name ) = 0;
126  virtual ISelectStatement* selector() = 0;
128  virtual StatusCode write() = 0;
130  virtual StatusCode writeRecord() = 0;
132  virtual StatusCode read() = 0;
134  virtual StatusCode readRecord() = 0;
136  virtual StatusCode save() = 0;
137  virtual ~INTuple() = default;
138 };
139 #endif
INTuple::remove
virtual StatusCode remove(INTupleItem *item)=0
Remove an item row (identified by pointer) from the N tuple.
INTupleItem::type
virtual long type() const =0
Type information of the item.
INTupleItem::reset
virtual void reset()=0
Reset column.
INTupleItem::indexItem
virtual const INTupleItem * indexItem() const =0
Pointer to index column (if present, 0 else) (CONST)
std::string
STL class.
INTupleItem::index
virtual const std::string & index() const =0
Access the index _Item.
INTuple::readRecord
virtual StatusCode readRecord()=0
Read record of the NTuple.
INTupleItem::length
virtual long length() const =0
Access the buffer length.
INTuple::save
virtual StatusCode save()=0
Save the NTuple.
INTuple::i_find
virtual INTupleItem * i_find(const std::string &name) const =0
Internally used by abstract classes.
INTuple::read
virtual StatusCode read()=0
Read record of the NTuple (Shortcut of readRecord)
std::vector
STL class.
std::type_info
INTuple::items
virtual const ItemContainer & items() const =0
Access item container (CONST)
INTupleItem::~INTupleItem
virtual ~INTupleItem()=default
destructor
ISelectStatement
Definition: ISelectStatement.h:42
INTupleItem::ndim
virtual long ndim() const =0
Dimension.
INTupleItem::typeID
virtual const std::type_info & typeID() const =0
Compiler type ID.
INTuple::find
virtual const INTupleItem * find(const std::string &name) const =0
Find an item row of the Ntuple (CONST)
INTuple::buffer
virtual const char * buffer() const =0
Access data buffer (CONST)
StatusCode.h
INTuple::setBuffer
virtual char * setBuffer(char *buff)=0
Attach data buffer.
INTupleItem::tuple
virtual INTuple * tuple()=0
NTuple the item belongs to.
INTuple::items
virtual ItemContainer & items()=0
Access item container.
INTupleItem::hasIndex
virtual bool hasIndex() const =0
Is the tuple have an index item?
INTuple::attachSelector
virtual StatusCode attachSelector(ISelectStatement *sel)=0
Attach selector.
INTuple::ItemContainer
std::vector< INTupleItem * > ItemContainer
Definition: INTuple.h:98
INTuple::writeRecord
virtual StatusCode writeRecord()=0
Write record of the NTuple.
StatusCode
Definition: StatusCode.h:65
INTuple::buffer
virtual char * buffer()=0
Access data buffer.
INTuple::write
virtual StatusCode write()=0
Write record of the NTuple (Shortcut of writeRecord)
INTupleItem::buffer
virtual const void * buffer() const =0
Access data buffer (CONST)
INTupleItem::typeName
virtual std::string typeName() const =0
Proper type name of the object.
INTuple
Definition: INTuple.h:91
INTupleItem::filled
virtual long filled() const =0
Number of items filled.
INTuple::remove
virtual StatusCode remove(const std::string &name)=0
Remove an item row (identified by name) from the N tuple.
INTuple::add
virtual StatusCode add(INTupleItem *item)=0
Add an item row to the N tuple.
INTupleItem
Definition: INTuple.h:37
IOTest.sel
sel
Definition: IOTest.py:106
INTupleItem::dim
virtual long dim(long i) const =0
Access individual dimensions.
INTuple::selector
virtual ISelectStatement * selector()=0
Access selector.
INTuple::~INTuple
virtual ~INTuple()=default
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
INTupleItem::setType
virtual void setType(long typ)=0
Set the properties of the INTupleItem.
INTupleItem::size
virtual long size() const =0
Size of entire object.
Kernel.h
INTuple::title
virtual const std::string & title() const =0
Object title.
INTupleItem::name
virtual const std::string & name() const =0
Access _Item name.
INTuple::reset
virtual void reset()=0
Reset all entries to their default values.
INTupleItem::release
virtual void release()=0
Destruct object.
INTuple::find
virtual INTupleItem * find(const std::string &name)=0
Find an item row of the Ntuple.
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
INTupleItem::indexItem
virtual INTupleItem * indexItem()=0
Pointer to index column (if present, 0 else)