1 | // @(#)root/tree:$Id: MBasketSQL.h 35231 2010-09-10 17:59:10Z pcanal $
|
---|
2 | // Author: Philippe Canal 2005
|
---|
3 |
|
---|
4 | /*************************************************************************
|
---|
5 | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
|
---|
6 | * All rights reserved. *
|
---|
7 | * *
|
---|
8 | * For the licensing terms see $ROOTSYS/LICENSE. *
|
---|
9 | * For the list of contributors see $ROOTSYS/README/CREDITS. *
|
---|
10 | *************************************************************************/
|
---|
11 |
|
---|
12 | #ifndef TBASKETSQL_H
|
---|
13 | #define TBASKETSQL_H
|
---|
14 |
|
---|
15 | //////////////////////////////////////////////////////////////////////////
|
---|
16 | // //
|
---|
17 | // MBasketSQL //
|
---|
18 | // //
|
---|
19 | // Implement TBasket for a SQL backend //
|
---|
20 | // //
|
---|
21 | //////////////////////////////////////////////////////////////////////////
|
---|
22 |
|
---|
23 | #include <vector>
|
---|
24 | #include "TBasket.h"
|
---|
25 |
|
---|
26 | class TSQLResult;
|
---|
27 | class TSQLRow;
|
---|
28 | class MBufferSQL;
|
---|
29 |
|
---|
30 | class MBasketSQL : public TBasket
|
---|
31 | {
|
---|
32 |
|
---|
33 | private:
|
---|
34 | MBasketSQL(const MBasketSQL&); // MBasketSQL objects are not copiable.
|
---|
35 | MBasketSQL& operator=(const MBasketSQL&); // MBasketSQL objects are not copiable.
|
---|
36 |
|
---|
37 | protected:
|
---|
38 | TSQLResult **fResultPtr; //!
|
---|
39 | TSQLRow **fRowPtr; //!
|
---|
40 | TString *fInsertQuery; //!
|
---|
41 |
|
---|
42 | public:
|
---|
43 | MBasketSQL();
|
---|
44 | MBasketSQL(const char *name, const char *title,
|
---|
45 | TBranch *branch, TSQLResult **rs,
|
---|
46 | TString *insert_query, std::vector<Int_t> *vc, TSQLRow **row);
|
---|
47 | ~MBasketSQL();
|
---|
48 | void PrepareBasket(Long64_t entry);
|
---|
49 | virtual Int_t ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file);
|
---|
50 | virtual Int_t ReadBasketBytes(Long64_t pos, TFile *file);
|
---|
51 | virtual void Reset();
|
---|
52 | TSQLResult * GetResultSet() { return *fResultPtr;}
|
---|
53 | void CreateBuffer(const char *name, TString title, std::vector<Int_t> * vc, TBranch *branch, TSQLResult ** rs);
|
---|
54 |
|
---|
55 | void Update(Int_t offset, Int_t skipped);
|
---|
56 |
|
---|
57 | ClassDef(MBasketSQL,1) //the TBranch buffers
|
---|
58 |
|
---|
59 | };
|
---|
60 |
|
---|
61 | #endif
|
---|