Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
25#include <vector>
26#include <string>
27
28class TSQLRow;
29
30class TBufferSQL final : public TBufferFile {
31
32private:
33 std::vector<Int_t>::const_iterator fIter;
34
35 std::vector<Int_t> *fColumnVec{nullptr}; //!
36 TString *fInsertQuery{nullptr}; //!
37 TSQLRow **fRowPtr{nullptr}; //!
38
39 // TBuffer objects cannot be copied or assigned
40 TBufferSQL(const TBufferSQL &); // not implemented
41 void operator=(const TBufferSQL &); // not implemented
42
43public:
44 TBufferSQL();
45 TBufferSQL(TBuffer::EMode mode, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr);
46 TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr);
47 TBufferSQL(TBuffer::EMode mode, Int_t bufsiz, std::vector<Int_t> *vc, TString *insert_query, TSQLRow **rowPtr,void *buf, bool adopt = true);
48 ~TBufferSQL() override;
49
50 void ResetOffset();
51
52 void ReadBool(bool &b) final;
53 void ReadChar(Char_t &c) final;
54 void ReadUChar(UChar_t &c) final;
55 void ReadShort(Short_t &s) final;
56 void ReadUShort(UShort_t &s) final;
57 void ReadInt(Int_t &i) final;
58 void ReadUInt(UInt_t &i) final;
59 void ReadLong(Long_t &l) final;
60 void ReadULong(ULong_t &l) final;
61 void ReadLong64(Long64_t &l) final;
62 void ReadULong64(ULong64_t &l) final;
63 void ReadFloat(Float_t &f) final;
64 void ReadDouble(Double_t &d) final;
65 void ReadCharP(Char_t *c) final;
66 void ReadTString(TString &s) final;
67 void ReadStdString(std::string *s) final;
69 void ReadCharStar(char* &s) final;
70
71 void WriteBool(bool b) final;
72 void WriteChar(Char_t c) final;
73 void WriteUChar(UChar_t c) final;
74 void WriteShort(Short_t s) final;
75 void WriteUShort(UShort_t s) final;
76 void WriteInt(Int_t i) final;
77 void WriteUInt(UInt_t i) final;
78 void WriteLong(Long_t l) final;
79 void WriteULong(ULong_t l) final;
80 void WriteLong64(Long64_t l) final;
81 void WriteULong64(ULong64_t l) final;
82 void WriteFloat(Float_t f) final;
83 void WriteDouble(Double_t d) final;
84 void WriteCharP(const Char_t *c) final;
85 void WriteTString(const TString &s) final;
86 void WriteStdString(const std::string *s) final;
88 void WriteCharStar(char *s) final;
89
90 void WriteFastArray(const bool *b, Long64_t n) final;
91 void WriteFastArray(const Char_t *c, Long64_t n) final;
92 void WriteFastArrayString(const Char_t *c, Long64_t n) final;
93 void WriteFastArray(const UChar_t *c, Long64_t n) final;
94 void WriteFastArray(const Short_t *h, Long64_t n) final;
95 void WriteFastArray(const UShort_t *h, Long64_t n) final;
96 void WriteFastArray(const Int_t *i, Long64_t n) final;
97 void WriteFastArray(const UInt_t *i, Long64_t n) final;
98 void WriteFastArray(const Long_t *l, Long64_t n) final;
99 void WriteFastArray(const ULong_t *l, Long64_t n) final;
100 void WriteFastArray(const Long64_t *l, Long64_t n) final;
101 void WriteFastArray(const ULong64_t *l, Long64_t n) final;
102 void WriteFastArray(const Float_t *f, Long64_t n) final;
103 void WriteFastArray(const Double_t *d, Long64_t n) final;
104 void WriteFastArray(void *start, const TClass *cl, Long64_t n=1, TMemberStreamer *s=nullptr) final;
105 Int_t WriteFastArray(void **startp, const TClass *cl, Long64_t n=1, bool isPreAlloc=false, TMemberStreamer *s=nullptr) final;
106
107 void ReadFastArray(bool *, Int_t ) final;
108 void ReadFastArray(Char_t *, Int_t ) final;
109 void ReadFastArrayString(Char_t *, Int_t ) final;
110 void ReadFastArray(UChar_t *, Int_t ) final;
111 void ReadFastArray(Short_t *, Int_t ) final;
112 void ReadFastArray(UShort_t *, Int_t ) final;
113 void ReadFastArray(Int_t *, Int_t ) final;
114 void ReadFastArray(UInt_t *, Int_t ) final;
115 void ReadFastArray(Long_t *, Int_t ) final;
116 void ReadFastArray(ULong_t *, Int_t ) final;
117 void ReadFastArray(Long64_t *, Int_t ) final;
118 void ReadFastArray(ULong64_t *, Int_t ) final;
119 void ReadFastArray(Float_t *, Int_t ) final;
120 void ReadFastArray(Double_t *, Int_t ) final;
121 void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final;
122 void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) final;
123 void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
124 void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final;
125 void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
126 void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) final;
127 void ReadFastArray(void *, const TClass *, Int_t n=1, TMemberStreamer *s=nullptr, const TClass *onFileClass=nullptr) final;
128 void ReadFastArray(void **, const TClass *, Int_t n=1, bool isPreAlloc=false, TMemberStreamer *s=nullptr, const TClass *onFileClass=nullptr) final;
129
130 ClassDefOverride(TBufferSQL, 0); // Implementation of TBuffer to load and write to a SQL database
131
132};
133
134#endif
135
136
#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:40
unsigned char UChar_t
Definition RtypesCore.h:38
char Char_t
Definition RtypesCore.h:37
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
float Float_t
Definition RtypesCore.h:57
short Short_t
Definition RtypesCore.h:39
long long Long64_t
Definition RtypesCore.h:69
unsigned long long ULong64_t
Definition RtypesCore.h:70
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char mode
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition TBufferFile.h:47
Implement TBuffer for a SQL backend.
Definition TBufferSQL.h:30
void ReadLong(Long_t &l) final
Operator>>
void WriteDouble(Double_t d) final
Operator<<.
void ReadFastArray(bool *, Int_t) final
ReadFastArray SQL implementation.
TBufferSQL()
Constructor.
TBufferSQL(const TBufferSQL &)
void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
void WriteFastArrayString(const Char_t *c, Long64_t n) final
WriteFastArray SQL implementation.
TSQLRow ** fRowPtr
Definition TBufferSQL.h:37
void WriteULong(ULong_t l) final
Operator<<.
void WriteUInt(UInt_t i) final
Operator<<.
void WriteFloat(Float_t f) final
Operator<<.
void ReadULong64(ULong64_t &l) final
Operator>>
void ReadCharStar(char *&s) final
Read a char* string.
void ReadInt(Int_t &i) final
Operator>>
void ReadTString(TString &s) final
Read a TString.
void WriteUChar(UChar_t c) final
Operator<<.
void WriteShort(Short_t s) final
Operator<<.
void WriteUShort(UShort_t s) final
Operator<<.
void ReadShort(Short_t &s) final
Operator>>
void WriteLong(Long_t l) final
Operator<<.
void ReadLong64(Long64_t &l) final
Operator>>
void operator=(const TBufferSQL &)
TString * fInsertQuery
Definition TBufferSQL.h:36
void ReadChar(Char_t &c) final
Operator>>
std::vector< Int_t > * fColumnVec
Definition TBufferSQL.h:35
void ReadFastArrayString(Char_t *, Int_t) final
ReadFastArray SQL implementation.
void WriteStdString(const std::string *s) final
Write a std::string.
void ReadStdString(std::string *s) final
Read a std::string.
void WriteInt(Int_t i) final
Operator<<.
void ReadUShort(UShort_t &s) final
Operator>>
void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final
Read array of Float16_t from buffer.
void WriteTString(const TString &s) final
Write a TString.
void ReadUInt(UInt_t &i) final
Operator>>
void WriteULong64(ULong64_t l) final
Operator<<.
~TBufferSQL() override
Destructor.
void ReadCharP(Char_t *c) final
Operator>>
void WriteCharStar(char *s) final
Write a char* string.
void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final
Read array of Float16_t from buffer.
std::vector< Int_t >::const_iterator fIter
Definition TBufferSQL.h:33
void WriteFastArray(const bool *b, Long64_t n) final
WriteFastArray SQL implementation.
void ResetOffset()
Reset Offset.
void WriteBool(bool b) final
Operator<<.
void WriteCharP(const Char_t *c) final
Operator<<.
void WriteLong64(Long64_t l) final
Operator<<.
void ReadDouble(Double_t &d) final
Operator>>
void ReadULong(ULong_t &l) final
Operator>>
void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=nullptr) final
ReadFastArray SQL implementation.
void ReadFloat(Float_t &f) final
Operator>>
void WriteChar(Char_t c) final
Operator<<.
void ReadBool(bool &b) final
Operator>>
void ReadUChar(UChar_t &c) final
Operator>>
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:81
Basic string class.
Definition TString.h:139
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4