Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:07:15

0001 /***********************************************************************************\
0002 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
0003 *                                                                                   *
0004 * This software is distributed under the terms of the Apache version 2 licence,     *
0005 * copied verbatim in the file "LICENSE".                                            *
0006 *                                                                                   *
0007 * In applying this licence, CERN does not waive the privileges and immunities       *
0008 * granted to it by virtue of its status as an Intergovernmental Organization        *
0009 * or submit itself to any jurisdiction.                                             *
0010 \***********************************************************************************/
0011 #ifndef GAUDIKERNEL_INTUPLE_H
0012 #define GAUDIKERNEL_INTUPLE_H
0013 
0014 // STL include files
0015 #include <string>
0016 #include <typeinfo>
0017 #include <vector>
0018 
0019 // Framework include files
0020 #include "GaudiKernel/Kernel.h"
0021 #include "GaudiKernel/StatusCode.h"
0022 
0023 // Forward declarations
0024 class INTuple;
0025 class INTupleItem;
0026 class ISelectStatement;
0027 
0028 /** @class INTupleItem INTuple.h GaudiKernel/INTuple.h
0029 
0030     NTuple interface class definition
0031 
0032     Definition of the interface to an Ntuple class beeing
0033     a sequence(=Item) of data entries.
0034 
0035     @author M.Frank
0036 */
0037 class GAUDI_API INTupleItem {
0038 protected:
0039   /// Set the properties of the INTupleItem
0040   virtual void setType( long typ ) = 0;
0041 
0042 public:
0043   /// destructor
0044   virtual ~INTupleItem() = default;
0045 
0046   /// Destruct object
0047   virtual void release() = 0;
0048   /// Compiler type ID
0049   virtual const std::type_info& typeID() const = 0;
0050   /// Proper type name of the object
0051   virtual std::string typeName() const = 0;
0052   /// Access data buffer (CONST)
0053   virtual const void* buffer() const = 0;
0054   /// Is the tuple have an index item?
0055   virtual bool hasIndex() const = 0;
0056   /// Access the index _Item
0057   virtual const std::string& index() const = 0;
0058   /// Access _Item name
0059   virtual const std::string& name() const = 0;
0060   /// Type information of the item
0061   virtual long type() const = 0;
0062   /// Access the buffer length
0063   virtual long length() const = 0;
0064   /// Reset column
0065   virtual void reset() = 0;
0066   /// Dimension
0067   virtual long ndim() const = 0;
0068   /// Access individual dimensions
0069   virtual long dim( long i ) const = 0;
0070   /// Size of entire object
0071   virtual long size() const = 0;
0072   /// Number of items filled
0073   virtual long filled() const = 0;
0074   /// Pointer to index column (if present, 0 else)
0075   virtual INTupleItem* indexItem() = 0;
0076   /// Pointer to index column (if present, 0 else) (CONST)
0077   virtual const INTupleItem* indexItem() const = 0;
0078   /// NTuple the item belongs to
0079   virtual INTuple* tuple() = 0;
0080 };
0081 
0082 /** @class INTuple INTuple.h GaudiKernel/INTuple.h
0083 
0084     NTuple interface class definition
0085 
0086     Definition of the interface to an Ntuple class beeing
0087     a sequence(=Item) of data entries.
0088 
0089     @author M.Frank
0090 */
0091 class GAUDI_API INTuple {
0092 protected:
0093   /// Internally used by abstract classes
0094   virtual INTupleItem* i_find( const std::string& name ) const = 0;
0095 
0096 public:
0097   // Definition of _Item container
0098   typedef std::vector<INTupleItem*> ItemContainer;
0099   /// Access item container
0100   virtual ItemContainer& items() = 0;
0101   /// Access item container   (CONST)
0102   virtual const ItemContainer& items() const = 0;
0103   /// Attach data buffer
0104   virtual char* setBuffer( char* buff ) = 0;
0105   /// Access data buffer (CONST)
0106   virtual const char* buffer() const = 0;
0107   /// Access data buffer
0108   virtual char* buffer() = 0;
0109   /// Object title
0110   virtual const std::string& title() const = 0;
0111   /// Reset all entries to their default values
0112   virtual void reset() = 0;
0113   /// Find an item row of the Ntuple (CONST)
0114   virtual const INTupleItem* find( const std::string& name ) const = 0;
0115   /// Find an item row of the   Ntuple
0116   virtual INTupleItem* find( const std::string& name ) = 0;
0117   /// Add an item row to the N tuple
0118   virtual StatusCode add( INTupleItem* item ) = 0;
0119   /// Remove an item row (identified by pointer) from the N tuple
0120   virtual StatusCode remove( INTupleItem* item ) = 0;
0121   /// Remove an item row (identified by name) from the N tuple
0122   virtual StatusCode remove( const std::string& name ) = 0;
0123   /// Attach selector
0124   virtual StatusCode attachSelector( ISelectStatement* sel ) = 0;
0125   /// Access selector
0126   virtual ISelectStatement* selector() = 0;
0127   /// Write record of the NTuple (Shortcut of writeRecord)
0128   virtual StatusCode write() = 0;
0129   /// Write record of the NTuple
0130   virtual StatusCode writeRecord() = 0;
0131   /// Read record of the NTuple (Shortcut of readRecord)
0132   virtual StatusCode read() = 0;
0133   /// Read record of the NTuple
0134   virtual StatusCode readRecord() = 0;
0135   /// Save the NTuple
0136   virtual StatusCode save() = 0;
0137   virtual ~INTuple()        = default;
0138 };
0139 #endif