source: branches/Mars_IncreaseNsb/msql/MBasketSQL.cc@ 20051

Last change on this file since 20051 was 15439, checked in by tbretz, 12 years ago
Removed all obsolete code from the root copied classes; now everything is returned asa double (enough for plots) and as a bonus time columns are now returned as a root axis-time; as a sql server reference MSqlServer is now used and tree is a member of MSqlServer.
File size: 2.6 KB
Line 
1//////////////////////////////////////////////////////////////////////////
2// //
3// MBasketSQL //
4// //
5// Implement TBasket for a SQL backend //
6// //
7//////////////////////////////////////////////////////////////////////////
8
9#ifndef MARS_MBasketSQL
10#define MARS_MBasketSQL
11
12#include "MBasketSQL.h"
13
14#include "TBasket.h"
15#include "TTree.h"
16#include "TBranch.h"
17#include "MBufferSQL.h"
18
19ClassImp(MBasketSQL)
20
21namespace std {} using namespace std;
22
23//_________________________________________________________________________
24MBasketSQL::MBasketSQL() : TBasket(), fRowPtr(0)
25{
26 // Default constructor.
27}
28
29//_________________________________________________________________________
30MBasketSQL::MBasketSQL(TBranch *branch, TSQLRow **sqlrow, Int_t index, TString type)
31{
32 // Create a TSQLBuffer for this basket.
33 SetName(branch->GetName());
34 SetTitle(branch->GetName());
35
36 fClassName = "MBasketSQL";
37
38 fBufferSize = branch->GetBasketSize();
39 fNevBufSize = branch->GetEntryOffsetLen();
40 fNevBuf = 0;
41 fEntryOffset = 0; //Must be set to 0 before calling Sizeof
42 fDisplacement= 0; //Must be set to 0 before calling Sizeof
43 fBuffer = 0; //Must be set to 0 before calling Sizeof
44 fBufferRef = 0;
45
46 fBufferRef = new MBufferSQL(sqlrow, index, type);
47
48 fHeaderOnly = kTRUE;
49 fLast = 0;
50 //Streamer(*fBufferRef);
51 fBuffer = 0;
52 fBranch = branch;
53 fHeaderOnly = kFALSE;
54 branch->GetTree()->IncrementTotalBuffers(fBufferSize);
55}
56
57//_________________________________________________________________________
58void MBasketSQL::PrepareBasket(Long64_t entry)
59{
60 // Prepare the basket for the next entry.
61 fBranch->GetTree()->LoadTree(entry);
62}
63
64//_________________________________________________________________________
65Int_t MBasketSQL::ReadBasketBytes(Long64_t , TFile *)
66{
67 Error("ReadBasketBytes","This member function should not be called!");
68 return 0;
69}
70
71//_________________________________________________________________________
72Int_t MBasketSQL::ReadBasketBuffers(Long64_t , Int_t, TFile *)
73{
74 Error("ReadBasketBuffers","This member function should not be called!");
75 return 0;
76}
77
78//_________________________________________________________________________
79void MBasketSQL::Update(Int_t, Int_t)
80{
81 // See TBasket::Update.
82 fNevBuf++;
83}
84
85#endif
Note: See TracBrowser for help on using the repository browser.