Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NTupleImplementation.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_NTUPLEIMP_H
2 #define GAUDIKERNEL_NTUPLEIMP_H
3 
4 #include <memory>
5 // Framework include files
6 #include "GaudiKernel/Kernel.h"
7 #include "GaudiKernel/NTuple.h"
8 #include "GaudiKernel/SmartIF.h"
9 
10 // Forward declarations
11 class INTupleSvc;
12 class IConversionSvc;
13 
14 namespace NTuple {
15  // Concrete N tuple class definition
16  class GAUDI_API TupleImp : public Tuple {
17  protected:
21  bool m_isBooked = false;
29  INTupleSvc* m_ntupleSvc = nullptr;
31  IConversionSvc* m_cnvSvc = nullptr;
32 
33  private:
35  TupleImp( const TupleImp& ) = delete;
36 
37  public:
39  INTupleItem* i_find( const std::string& name ) const override;
40 
41  public:
43  TupleImp( std::string title );
45  ~TupleImp() override;
47  ItemContainer& items() override { return m_items; }
49  const ItemContainer& items() const override { return m_items; }
51  const std::string& title() const override { return m_title; }
53  const INTupleItem* find( const std::string& name ) const override { return i_find( name ); }
55  INTupleItem* find( const std::string& name ) override { return i_find( name ); }
57  char* buffer() override { return m_buffer.get(); }
59  const char* buffer() const override { return m_buffer.get(); }
61  IConversionSvc* conversionService() const { return m_cnvSvc; }
63  void setConversionService( IConversionSvc* svc ) { m_cnvSvc = svc; }
65  INTupleSvc* tupleService() const { return m_ntupleSvc; }
67  void setTupleService( INTupleSvc* svc ) { m_ntupleSvc = svc; }
69  StatusCode attachSelector( ISelectStatement* sel ) override;
71  ISelectStatement* selector() override;
73  virtual char* setBuffer( std::unique_ptr<char[]>&& buff );
74  char* setBuffer( char* buff ) override;
76  void reset() override;
78  StatusCode add( INTupleItem* item ) override;
80  StatusCode remove( INTupleItem* item ) override;
82  StatusCode remove( const std::string& name ) override;
84  StatusCode write() override;
86  StatusCode writeRecord() override;
88  StatusCode read() override;
90  StatusCode readRecord() override;
92  StatusCode save() override;
93 
94  }; // end class definition: Tuple
95 
96  // Concrete column wise N tuple class definition
97  class ColumnWiseTuple : public TupleImp {
98  public:
100  ColumnWiseTuple( std::string title ) : TupleImp( std::move( title ) ) {}
102  const CLID& clID() const override { return classID(); }
104  static const CLID& classID() { return CLID_ColumnWiseTuple; }
105  }; // end class definition: ColumnWiseTuple
106 
107  // Concrete column wise N tuple class definition
108  class RowWiseTuple : public TupleImp {
109  public:
111  RowWiseTuple( std::string title ) : TupleImp( std::move( title ) ) {}
113  const CLID& clID() const override { return classID(); }
115  static const CLID& classID() { return CLID_RowWiseTuple; }
116  }; // end class definition: RowWiseTuple
117 } // namespace NTuple
118 
119 #endif // GAUDIKERNEL_NTUPLEIMP_H
const char * buffer() const override
Access N tuple data buffer (CONST)
A select statement can either contain.
std::unique_ptr< char[]> m_buffer
Buffer.
sel
Definition: IOTest.py:93
const ItemContainer & items() const override
Access item container (CONST)
const CLID & clID() const override
Retrieve Reference to class defininition structure.
STL namespace.
def read(f, regex='.*', skipevents=0)
Definition: hivetimeline.py:22
INTupleItem * find(const std::string &name) override
Find an item row of the Ntuple.
RowWiseTuple(std::string title)
Standard Constructor.
NTuple name space.
Definition: INTupleSvc.h:9
static const CLID & classID()
Static access to class defininition structure.
ColumnWiseTuple(std::string title)
Standard Constructor.
STL class.
NTuple interface class definition.
Definition: INTuple.h:27
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
ItemContainer & items() override
Access item container.
std::string m_title
N tuple title.
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
T get(T...args)
const std::string & title() const override
Object title.
STL class.
SmartIF< ISelectStatement > m_pSelector
Possibly hanging selector.
ItemContainer m_items
Container with N tuple _Columns.
void setTupleService(INTupleSvc *svc)
Access conversion service.
void setConversionService(IConversionSvc *svc)
Access conversion service.
const CLID & clID() const override
Retrieve Reference to class defininition structure.
const INTupleItem * find(const std::string &name) const override
Find an item row of the Ntuple (CONST)
#define GAUDI_API
Definition: Kernel.h:71
static const CLID & classID()
Static access to class defininition structure.
INTupleSvc * tupleService() const
Access conversion service.
char * buffer() override
Access N tuple data buffer.
IConversionSvc * conversionService() const
Access conversion service.