Logo ROOT  
Reference Guide
TBufferSQL.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
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 ROOT_TBufferSQL
13#define ROOT_TBufferSQL
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// TBufferSQL //
18// //
19// Implement TBuffer for a SQL backend //
20// //
21//////////////////////////////////////////////////////////////////////////
22
23#include "TBufferFile.h"
24
25class TSQLRow;
26
27class TBufferSQL final : public TBufferFile {
28
29private:
30 std::vector<Int_t>::const_iterator fIter;
31
32 std::vector<Int_t> *fColumnVec{nullptr}; //!
33 TString *fInsertQuery{nullptr}; //!
34 TSQLRow **fRowPtr{nullptr}; //!
35
36 // TBuffer objects cannot be copied or assigned
37 TBufferSQL(const TBufferSQL &); // not implemented
38 void operator=(const TBufferSQL &); // not implemented
39
40public:
41 TBufferSQL();
42 TBufferSQL(TBuffer::EMode mode, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr);
43 TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr);
44 TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr,void *buf, Bool_t adopt = kTRUE);
46
47 void ResetOffset();
48
49 void ReadBool(Bool_t &b) final;
50 void ReadChar(Char_t &c) final;
51 void ReadUChar(UChar_t &c) final;
52 void ReadShort(Short_t &s) final;
53 void ReadUShort(UShort_t &s) final;
54 void ReadInt(Int_t &i) final;
55 void ReadUInt(UInt_t &i) final;
56 void ReadLong(Long_t &l) final;
57 void ReadULong(ULong_t &l) final;
58 void ReadLong64(Long64_t &l) final;
59 void ReadULong64(ULong64_t &l) final;
60 void ReadFloat(Float_t &f) final;
61 void ReadDouble(Double_t &d) final;
62 void ReadCharP(Char_t *c) final;
63 void ReadTString(TString &s) final;
64 void ReadStdString(std::string *s) final;
66 void ReadCharStar(char* &s) final;
67
68 void WriteBool(Bool_t b) final;
69 void WriteChar(Char_t c) final;
70 void WriteUChar(UChar_t c) final;
71 void WriteShort(Short_t s) final;
72 void WriteUShort(UShort_t s) final;
73 void WriteInt(Int_t i) final;
74 void WriteUInt(UInt_t i) final;
75 void WriteLong(Long_t l) final;
76 void WriteULong(ULong_t l) final;
77 void WriteLong64(Long64_t l) final;
78 void WriteULong64(ULong64_t l) final;
79 void WriteFloat(Float_t f) final;
80 void WriteDouble(Double_t d) final;
81 void WriteCharP(const Char_t *c) final;
82 void WriteTString(const TString &s) final;
83 void WriteStdString(const std::string *s) final;
85 void WriteCharStar(char *s) final;
86
87 void WriteFastArray(const Bool_t *b, Int_t n) final;
88 void WriteFastArray(const Char_t *c, Int_t n) final;
89 void WriteFastArrayString(const Char_t *c, Int_t n) final;
90 void WriteFastArray(const UChar_t *c, Int_t n) final;
91 void WriteFastArray(const Short_t *h, Int_t n) final;
92 void WriteFastArray(const UShort_t *h, Int_t n) final;
93 void WriteFastArray(const Int_t *i, Int_t n) final;
94 void WriteFastArray(const UInt_t *i, Int_t n) final;
95 void WriteFastArray(const Long_t *l, Int_t n) final;
96 void WriteFastArray(const ULong_t *l, Int_t n) final;
97 void WriteFastArray(const Long64_t *l, Int_t n) final;
98 void WriteFastArray(const ULong64_t *l, Int_t n) final;
99 void WriteFastArray(const Float_t *f, Int_t n) final;
100 void WriteFastArray(const Double_t *d, Int_t n) final;
101 void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=nullptr) final;
102 Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=nullptr) final;
103
104 void ReadFastArray(Bool_t *, Int_t ) final;
105 void ReadFastArray(Char_t *, Int_t ) final;
106 void ReadFastArrayString(Char_t *, Int_t ) final;
107 void ReadFastArray(UChar_t *, Int_t ) final;
108 void ReadFastArray(Short_t *, Int_t ) final;
109 void ReadFastArray(UShort_t *, Int_t ) final;
110 void ReadFastArray(Int_t *, Int_t ) final;
111 void ReadFastArray(UInt_t *, Int_t ) final;
112 void ReadFastArray(Long_t *, Int_t ) final;
113 void ReadFastArray(ULong_t *, Int_t ) final;
114 void ReadFastArray(Long64_t *, Int_t ) final;
115 void ReadFastArray(ULong64_t *, Int_t ) final;
116 void ReadFastArray(Float_t *, Int_t ) final;
117 void ReadFastArray(Double_t *, Int_t ) final;
118 void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final;
119 void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) final;
120 void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
121 void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final;
122 void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
123 void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) final;
124 void ReadFastArray(void *, const TClass *, Int_t n=1, TMemberStreamer *s=nullptr, const TClass *onFileClass=nullptr) final;
125 void ReadFastArray(void **, const TClass *, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=nullptr, const TClass *onFileClass=nullptr) final;
126
127 ClassDefOverride(TBufferSQL, 0); // Implementation of TBuffer to load and write to a SQL database
128
129};
130
131#endif
132
133
#define d(i)
Definition: RSha256.hxx:102
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
unsigned short UShort_t
Definition: RtypesCore.h:36
int Int_t
Definition: RtypesCore.h:41
unsigned char UChar_t
Definition: RtypesCore.h:34
char Char_t
Definition: RtypesCore.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
short Short_t
Definition: RtypesCore.h:35
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
unsigned long long ULong64_t
Definition: RtypesCore.h:70
float Float_t
Definition: RtypesCore.h:53
const Bool_t kTRUE
Definition: RtypesCore.h:87
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition: TBufferFile.h:46
Implement TBuffer for a SQL backend.
Definition: TBufferSQL.h:27
void ReadLong(Long_t &l) final
Operator>>
Definition: TBufferSQL.cxx:131
void WriteDouble(Double_t d) final
Operator<<.
Definition: TBufferSQL.cxx:211
~TBufferSQL()
Destructor.
Definition: TBufferSQL.cxx:73
TBufferSQL()
Constructor.
Definition: TBufferSQL.cxx:66
TBufferSQL(const TBufferSQL &)
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
Definition: TBufferSQL.cxx:759
void WriteFastArray(const Bool_t *b, Int_t n) final
WriteFastArray SQL implementation.
Definition: TBufferSQL.cxx:425
TSQLRow ** fRowPtr
Definition: TBufferSQL.h:34
void WriteULong(ULong_t l) final
Operator<<.
Definition: TBufferSQL.cxx:384
void WriteUInt(UInt_t i) final
Operator<<.
Definition: TBufferSQL.cxx:374
void WriteFloat(Float_t f) final
Operator<<.
Definition: TBufferSQL.cxx:201
void ReadULong64(ULong64_t &l) final
Operator>>
Definition: TBufferSQL.cxx:277
void ReadCharStar(char *&s) final
Read a char* string.
Definition: TBufferSQL.cxx:335
void ReadInt(Int_t &i) final
Operator>>
Definition: TBufferSQL.cxx:111
void ReadTString(TString &s) final
Read a TString.
Definition: TBufferSQL.cxx:298
void WriteUChar(UChar_t c) final
Operator<<.
Definition: TBufferSQL.cxx:354
void WriteShort(Short_t s) final
Operator<<.
Definition: TBufferSQL.cxx:171
void WriteUShort(UShort_t s) final
Operator<<.
Definition: TBufferSQL.cxx:364
void ReadBool(Bool_t &b) final
Operator>>
Definition: TBufferSQL.cxx:81
void ReadShort(Short_t &s) final
Operator>>
Definition: TBufferSQL.cxx:101
void WriteLong(Long_t l) final
Operator<<.
Definition: TBufferSQL.cxx:191
void ReadLong64(Long64_t &l) final
Operator>>
Definition: TBufferSQL.cxx:265
void operator=(const TBufferSQL &)
TString * fInsertQuery
Definition: TBufferSQL.h:33
void ReadChar(Char_t &c) final
Operator>>
Definition: TBufferSQL.cxx:91
std::vector< Int_t > * fColumnVec
Definition: TBufferSQL.h:32
void WriteFastArrayString(const Char_t *c, Int_t n) final
WriteFastArray SQL implementation.
Definition: TBufferSQL.cxx:449
void ReadFastArrayString(Char_t *, Int_t) final
ReadFastArray SQL implementation.
Definition: TBufferSQL.cxx:632
void WriteStdString(const std::string *s) final
Write a std::string.
Definition: TBufferSQL.cxx:327
void ReadStdString(std::string *s) final
Read a std::string.
Definition: TBufferSQL.cxx:319
ClassDefOverride(TBufferSQL, 0)
void WriteInt(Int_t i) final
Operator<<.
Definition: TBufferSQL.cxx:181
void ReadFastArray(Bool_t *, Int_t) final
ReadFastArray SQL implementation.
Definition: TBufferSQL.cxx:610
void ReadUShort(UShort_t &s) final
Operator>>
Definition: TBufferSQL.cxx:231
void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final
Read array of Float16_t from buffer.
Definition: TBufferSQL.cxx:767
void WriteTString(const TString &s) final
Write a TString.
Definition: TBufferSQL.cxx:307
void ReadUInt(UInt_t &i) final
Operator>>
Definition: TBufferSQL.cxx:241
void WriteBool(Bool_t b) final
Operator<<.
Definition: TBufferSQL.cxx:151
void WriteULong64(ULong64_t l) final
Operator<<.
Definition: TBufferSQL.cxx:404
void ReadCharP(Char_t *c) final
Operator>>
Definition: TBufferSQL.cxx:289
void WriteCharStar(char *s) final
Write a char* string.
Definition: TBufferSQL.cxx:343
void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final
Read array of Float16_t from buffer.
Definition: TBufferSQL.cxx:775
std::vector< Int_t >::const_iterator fIter
Definition: TBufferSQL.h:30
void ResetOffset()
Reset Offset.
Definition: TBufferSQL.cxx:823
void WriteCharP(const Char_t *c) final
Operator<<.
Definition: TBufferSQL.cxx:414
void WriteLong64(Long64_t l) final
Operator<<.
Definition: TBufferSQL.cxx:394
void ReadDouble(Double_t &d) final
Operator>>
Definition: TBufferSQL.cxx:141
void ReadULong(ULong_t &l) final
Operator>>
Definition: TBufferSQL.cxx:253
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
Definition: TBufferSQL.cxx:799
void ReadFloat(Float_t &f) final
Operator>>
Definition: TBufferSQL.cxx:121
void WriteChar(Char_t c) final
Operator<<.
Definition: TBufferSQL.cxx:161
void ReadUChar(UChar_t &c) final
Operator>>
Definition: TBufferSQL.cxx:221
virtual void WriteStdString(const std::string *s)=0
virtual void ReadStdString(std::string *s)=0
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:75
Basic string class.
Definition: TString.h:131
const Int_t n
Definition: legend1.C:16
static constexpr double s
auto * l
Definition: textangle.C:4