| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
16 // Concrete N tuple class definition
17 class GAUDI_API TupleImp : public Tuple
18 {
19 protected:
21 ItemContainer m_items;
23 bool m_isBooked = false;
25 std::string m_title;
27 SmartIF<ISelectStatement> m_pSelector;
29 std::unique_ptr<char[]> m_buffer;
31 INTupleSvc* m_ntupleSvc = nullptr;
33 IConversionSvc* m_cnvSvc = nullptr;
34
35 private:
37 TupleImp( const TupleImp& ) = delete;
38
39 public:
41 INTupleItem* i_find( const std::string& name ) const override;
42
43 public:
45 TupleImp( std::string title );
47 ~TupleImp() override;
49 ItemContainer& items() override { return m_items; }
51 const ItemContainer& items() const override { return m_items; }
53 const std::string& title() const override { return m_title; }
55 const INTupleItem* find( const std::string& name ) const override { return i_find( name ); }
57 INTupleItem* find( const std::string& name ) override { return i_find( name ); }
59 char* buffer() override { return m_buffer.get(); }
61 const char* buffer() const override { return m_buffer.get(); }
63 IConversionSvc* conversionService() const { return m_cnvSvc; }
65 void setConversionService( IConversionSvc* svc ) { m_cnvSvc = svc; }
67 INTupleSvc* tupleService() const { return m_ntupleSvc; }
69 void setTupleService( INTupleSvc* svc ) { m_ntupleSvc = svc; }
71 StatusCode attachSelector( ISelectStatement* sel ) override;
73 ISelectStatement* selector() override;
75 virtual char* setBuffer( std::unique_ptr<char[]>&& buff );
76 char* setBuffer( char* buff ) override;
78 void reset() override;
80 StatusCode add( INTupleItem* item ) override;
82 StatusCode remove( INTupleItem* item ) override;
84 StatusCode remove( const std::string& name ) override;
86 StatusCode write() override;
88 StatusCode writeRecord() override;
90 StatusCode read() override;
92 StatusCode readRecord() override;
94 StatusCode save() override;
95
96 }; // end class definition: Tuple
97
98 // Concrete column wise N tuple class definition
99 class ColumnWiseTuple : public TupleImp
100 {
101 public:
103 ColumnWiseTuple( std::string title ) : TupleImp( std::move( title ) ) {}
105 ~ColumnWiseTuple() override = default;
107 const CLID& clID() const override { return classID(); }
109 static const CLID& classID() { return CLID_ColumnWiseTuple; }
110 }; // end class definition: ColumnWiseTuple
111
112 // Concrete column wise N tuple class definition
113 class RowWiseTuple : public TupleImp
114 {
115 public:
117 RowWiseTuple( std::string title ) : TupleImp( std::move( title ) ) {}
119 ~RowWiseTuple() override = default;
121 const CLID& clID() const override { return classID(); }
123 static const CLID& classID() { return CLID_RowWiseTuple; }
124 }; // end class definition: RowWiseTuple
125 } // end name space NTuple
126
127 #endif // GAUDIKERNEL_NTUPLEIMP_H
NTuple::TupleImp::buffer
const char * buffer() const override
Access N tuple data buffer (CONST)
Definition: NTupleImplementation.h:61
SmartIF< ISelectStatement >
Kernel.h
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
IConversionSvc
Definition: IConversionSvc.h:37
ISelectStatement
A select statement can either contain.
Definition: ISelectStatement.h:32
NTuple::TupleImp::m_buffer
std::unique_ptr< char[]> m_buffer
Buffer.
Definition: NTupleImplementation.h:29
NTuple.h
IOTest.sel
sel
Definition: IOTest.py:95
NTuple::TupleImp::items
const ItemContainer & items() const override
Access item container (CONST)
Definition: NTupleImplementation.h:51
NTuple::RowWiseTuple::clID
const CLID & clID() const override
Retrieve Reference to class defininition structure.
Definition: NTupleImplementation.h:121
std
STL namespace.
hivetimeline.read
def read(f, regex='.*', skipevents=0)
Definition: hivetimeline.py:22
NTuple::TupleImp::find
INTupleItem * find(const std::string &name) override
Find an item row of the Ntuple.
Definition: NTupleImplementation.h:57
NTuple::RowWiseTuple::RowWiseTuple
RowWiseTuple(std::string title)
Standard Constructor.
Definition: NTupleImplementation.h:117
NTuple::ColumnWiseTuple
Definition: NTupleImplementation.h:99
NTuple
NTuple name space.
Definition: INTupleSvc.h:9
NTuple::RowWiseTuple::classID
static const CLID & classID()
Static access to class defininition structure.
Definition: NTupleImplementation.h:123
NTuple::ColumnWiseTuple::ColumnWiseTuple
ColumnWiseTuple(std::string title)
Standard Constructor.
Definition: NTupleImplementation.h:103
std::string
STL class.
INTupleSvc
Definition: INTupleSvc.h:37
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:27
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
NTuple::TupleImp
Definition: NTupleImplementation.h:17
SmartIF.h
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
NTuple::TupleImp::items
ItemContainer & items() override
Access item container.
Definition: NTupleImplementation.h:49
NTuple::TupleImp::m_title
std::string m_title
N tuple title.
Definition: NTupleImplementation.h:25
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:412
std::unique_ptr::get
T get(T...args)
NTuple::TupleImp::title
const std::string & title() const override
Object title.
Definition: NTupleImplementation.h:53
std::vector
STL class.
std::unique_ptr< char[]>
NTuple::TupleImp::m_pSelector
SmartIF< ISelectStatement > m_pSelector
Possibly hanging selector.
Definition: NTupleImplementation.h:27
NTuple::RowWiseTuple
Definition: NTupleImplementation.h:113
NTuple::TupleImp::m_items
ItemContainer m_items
Container with N tuple _Columns.
Definition: NTupleImplementation.h:21
NTuple::TupleImp::setTupleService
void setTupleService(INTupleSvc *svc)
Access conversion service.
Definition: NTupleImplementation.h:69
GaudiPython.GaudiAlgs.write
write
Definition: GaudiAlgs.py:1259
NTuple::TupleImp::setConversionService
void setConversionService(IConversionSvc *svc)
Access conversion service.
Definition: NTupleImplementation.h:65
NTuple::ColumnWiseTuple::clID
const CLID & clID() const override
Retrieve Reference to class defininition structure.
Definition: NTupleImplementation.h:107
NTuple::TupleImp::find
const INTupleItem * find(const std::string &name) const override
Find an item row of the Ntuple (CONST)
Definition: NTupleImplementation.h:55
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
NTuple::ColumnWiseTuple::classID
static const CLID & classID()
Static access to class defininition structure.
Definition: NTupleImplementation.h:109
NTuple::TupleImp::tupleService
INTupleSvc * tupleService() const
Access conversion service.
Definition: NTupleImplementation.h:67
NTuple::TupleImp::buffer
char * buffer() override
Access N tuple data buffer.
Definition: NTupleImplementation.h:59
NTuple::TupleImp::conversionService
IConversionSvc * conversionService() const
Access conversion service.
Definition: NTupleImplementation.h:63