Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBufferSQL.cxx
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Philippe Canal and al. 08/2004
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/** \class TBufferSQL
13\ingroup tree
14Implement TBuffer for a SQL backend.
15*/
16
17#include "TError.h"
18
19#include "TBasketSQL.h"
20#include "TBufferSQL.h"
21#include "TSQLResult.h"
22#include "TSQLRow.h"
23
24#include <cstdio>
25#include <cstdlib>
26#include <iostream>
27#include <limits>
28
30
31////////////////////////////////////////////////////////////////////////////////
32/// Constructor.
33
37 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r)
38{
39 fIter = fColumnVec->begin();
40}
41
42////////////////////////////////////////////////////////////////////////////////
43/// Constructor.
44
48 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r)
49{
50 fIter = fColumnVec->begin();
51}
52
53////////////////////////////////////////////////////////////////////////////////
54/// Constructor.
55
58 void *buf, bool adopt) :
60 fColumnVec(vc), fInsertQuery(insert_query), fRowPtr(r)
61{
62 fIter = fColumnVec->begin();
63}
64
65////////////////////////////////////////////////////////////////////////////////
66/// Constructor.
67
68TBufferSQL::TBufferSQL() : TBufferFile(), fColumnVec(nullptr),fInsertQuery(nullptr),fRowPtr(nullptr)
69{
70}
71
72////////////////////////////////////////////////////////////////////////////////
73/// Destructor.
74
79
80////////////////////////////////////////////////////////////////////////////////
81/// Operator>>
82
84{
85 b = (bool)atoi((*fRowPtr)->GetField(*fIter));
86
87 if (fIter != fColumnVec->end()) ++fIter;
88}
89
90////////////////////////////////////////////////////////////////////////////////
91/// Operator>>
92
94{
95 c = (Char_t)atoi((*fRowPtr)->GetField(*fIter));
96
97 if (fIter != fColumnVec->end()) ++fIter;
98}
99
100////////////////////////////////////////////////////////////////////////////////
101/// Operator>>
102
104{
105 h = (Short_t)atoi((*fRowPtr)->GetField(*fIter));
106
107 if (fIter != fColumnVec->end()) ++fIter;
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Operator>>
112
114{
115 i = atoi((*fRowPtr)->GetField(*fIter));
116
117 if (fIter != fColumnVec->end()) ++fIter;
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Operator>>
122
124{
125 f = atof((*fRowPtr)->GetField(*fIter));
126
127 if (fIter != fColumnVec->end()) ++fIter;
128}
129
130////////////////////////////////////////////////////////////////////////////////
131/// Operator>>
132
134{
135 l = atol((*fRowPtr)->GetField(*fIter));
136
137 if (fIter != fColumnVec->end()) ++fIter;
138}
139
140////////////////////////////////////////////////////////////////////////////////
141/// Operator>>
142
144{
145 d = atof((*fRowPtr)->GetField(*fIter));
146
147 if (fIter != fColumnVec->end()) ++fIter;
148}
149
150////////////////////////////////////////////////////////////////////////////////
151/// Operator<<
152
154{
155 (*fInsertQuery) += b;
156 (*fInsertQuery) += ",";
157 if (fIter != fColumnVec->end()) ++fIter;
158}
159
160////////////////////////////////////////////////////////////////////////////////
161/// Operator<<
162
164{
165 (*fInsertQuery) += c;
166 (*fInsertQuery) += ",";
167 if (fIter != fColumnVec->end()) ++fIter;
168}
169
170////////////////////////////////////////////////////////////////////////////////
171/// Operator<<
172
174{
175 (*fInsertQuery) += h;
176 (*fInsertQuery) += ",";
177 if (fIter != fColumnVec->end()) ++fIter;
178}
179
180////////////////////////////////////////////////////////////////////////////////
181/// Operator<<
182
184{
185 (*fInsertQuery) += i;
186 (*fInsertQuery) += ",";
187 if (fIter != fColumnVec->end()) ++fIter;
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Operator<<
192
194{
195 (*fInsertQuery) += l;
196 (*fInsertQuery) += ",";
197 if (fIter != fColumnVec->end()) ++fIter;
198}
199
200////////////////////////////////////////////////////////////////////////////////
201/// Operator<<
202
204{
205 (*fInsertQuery) += f;
206 (*fInsertQuery) += ",";
207 if (fIter != fColumnVec->end()) ++fIter;
208}
209
210////////////////////////////////////////////////////////////////////////////////
211/// Operator<<
212
214{
215 (*fInsertQuery) += d;
216 (*fInsertQuery) += ",";
217 if (fIter != fColumnVec->end()) ++fIter;
218}
219
220////////////////////////////////////////////////////////////////////////////////
221/// Operator>>
222
224{
225 uc = (UChar_t)atoi((*fRowPtr)->GetField(*fIter));
226
227 if (fIter != fColumnVec->end()) ++fIter;
228}
229
230////////////////////////////////////////////////////////////////////////////////
231/// Operator>>
232
234{
235 us = (UShort_t)atoi((*fRowPtr)->GetField(*fIter));
236
237 if (fIter != fColumnVec->end()) ++fIter;
238}
239
240////////////////////////////////////////////////////////////////////////////////
241/// Operator>>
242
244{
245 TString val = (*fRowPtr)->GetField(*fIter);
246 Int_t code = sscanf(val.Data(), "%u",&ui);
247 if(code == 0) Error("operator>>(UInt_t&)","Error reading UInt_t");
248
249 if (fIter != fColumnVec->end()) ++fIter;
250}
251
252////////////////////////////////////////////////////////////////////////////////
253/// Operator>>
254
256{
257 TString val = (*fRowPtr)->GetField(*fIter);
258 Int_t code = sscanf(val.Data(), "%lu",&ul);
259 if(code == 0) Error("operator>>(ULong_t&)","Error reading ULong_t");
260
261 if (fIter != fColumnVec->end()) ++fIter;
262}
263
264////////////////////////////////////////////////////////////////////////////////
265/// Operator>>
266
268{
269 TString val = (*fRowPtr)->GetField(*fIter);
270 Int_t code = sscanf(val.Data(), "%lld",&ll);
271 if(code == 0) Error("operator>>(ULong_t&)","Error reading Long64_t");
272
273 if (fIter != fColumnVec->end()) ++fIter;
274}
275
276////////////////////////////////////////////////////////////////////////////////
277/// Operator>>
278
280{
281 TString val = (*fRowPtr)->GetField(*fIter);
282 Int_t code = sscanf(val.Data(), "%llu",&ull);
283 if(code == 0) Error("operator>>(ULong_t&)","Error reading ULong64_t");
284
285 if (fIter != fColumnVec->end()) ++fIter;
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Operator>>
290
292{
293 strcpy(str,(*fRowPtr)->GetField(*fIter)); // Legacy interface, we have no way to know the user's buffer size ....
294 if (fIter != fColumnVec->end()) ++fIter;
295}
296
297////////////////////////////////////////////////////////////////////////////////
298/// Read a TString
299
301{
302 s = (*fRowPtr)->GetField(*fIter);
303 if (fIter != fColumnVec->end()) ++fIter;
304}
305
306////////////////////////////////////////////////////////////////////////////////
307/// Write a TString
308
310{
311 (*fInsertQuery) += s;
312 (*fInsertQuery) += ",";
313 if (fIter != fColumnVec->end()) ++fIter;
314}
315
316
317
318////////////////////////////////////////////////////////////////////////////////
319/// Read a std::string
320
321void TBufferSQL::ReadStdString(std::string *s)
322{
324}
325
326////////////////////////////////////////////////////////////////////////////////
327/// Write a std::string
328
329void TBufferSQL::WriteStdString(const std::string *s)
330{
332}
333
334////////////////////////////////////////////////////////////////////////////////
335/// Read a char* string
336
341
342////////////////////////////////////////////////////////////////////////////////
343/// Write a char* string
344
349
350
351// Method to send to database.
352
353////////////////////////////////////////////////////////////////////////////////
354/// Operator<<
355
357{
358 (*fInsertQuery) += uc;
359 (*fInsertQuery) += ",";
360 ++fIter;
361}
362
363////////////////////////////////////////////////////////////////////////////////
364/// Operator<<
365
367{
368 (*fInsertQuery) += us;
369 (*fInsertQuery) += ",";
370 ++fIter;
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Operator<<
375
377{
378 (*fInsertQuery) += ui;
379 (*fInsertQuery) += ",";
380 ++fIter;
381}
382
383////////////////////////////////////////////////////////////////////////////////
384/// Operator<<
385
387{
388 (*fInsertQuery) += ul;
389 (*fInsertQuery) += ",";
390 ++fIter;
391}
392
393////////////////////////////////////////////////////////////////////////////////
394/// Operator<<
395
397{
398 (*fInsertQuery) += ll;
399 (*fInsertQuery) += ",";
400 ++fIter;
401}
402
403////////////////////////////////////////////////////////////////////////////////
404/// Operator<<
405
407{
408 (*fInsertQuery) += ull;
409 (*fInsertQuery) += ",";
410 ++fIter;
411}
412
413////////////////////////////////////////////////////////////////////////////////
414/// Operator<<
415
417{
418 (*fInsertQuery) += "\"";
419 (*fInsertQuery) += str;
420 (*fInsertQuery) += "\",";
421 ++fIter;
422}
423
424////////////////////////////////////////////////////////////////////////////////
425/// WriteFastArray SQL implementation.
426/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
427
429{
430 constexpr Int_t dataWidth = 2; // 2 chars
431 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
433 {
434 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
435 return; // In case the user re-routes the error handler to not die when Fatal is called
436 }
437 for(int i=0; i<n; ++i) {
438 (*fInsertQuery) += b[i];
439 (*fInsertQuery) += ",";
440 ++fIter;
441 }
442}
443
444////////////////////////////////////////////////////////////////////////////////
445/// WriteFastArray SQL implementation.
446/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
447
449{
450 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more
451 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
453 {
454 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
455 return; // In case the user re-routes the error handler to not die when Fatal is called
456 }
457 for(int i=0; i<n; ++i) {
458 (*fInsertQuery) += (Short_t)c[i];
459 (*fInsertQuery) += ",";
460 ++fIter;
461 }
462}
463
464////////////////////////////////////////////////////////////////////////////////
465/// WriteFastArray SQL implementation.
466/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
467
469{
470 constexpr Int_t dataWidth = 4; // 4 chars
471 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
472 if (maxElements < 1)
473 {
474 Fatal("WriteFastArrayString", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", 1LL, maxElements);
475 return; // In case the user re-routes the error handler to not die when Fatal is called
476 }
477 (*fInsertQuery) += "\"";
478 (*fInsertQuery) += c;
479 (*fInsertQuery) += "\",";
480 ++fIter;
481}
482
483////////////////////////////////////////////////////////////////////////////////
484/// WriteFastArray SQL implementation.
485/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
486
488{
489 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
490 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
492 {
493 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
494 return; // In case the user re-routes the error handler to not die when Fatal is called
495 }
496 for(int i=0; i<n; ++i) {
497 (*fInsertQuery) += uc[i];
498 (*fInsertQuery) += ",";
499 ++fIter;
500 }
501}
502
503////////////////////////////////////////////////////////////////////////////////
504/// WriteFastArray SQL implementation.
505/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
506
508{
509 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
510 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
512 {
513 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
514 return; // In case the user re-routes the error handler to not die when Fatal is called
515 }
516 for(int i=0; i<n; ++i) {
517 (*fInsertQuery) += h[i];
518 (*fInsertQuery) += ",";
519 ++fIter;
520 }
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// WriteFastArray SQL implementation.
525/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
526
527
529{
530 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
531 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
533 {
534 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
535 return; // In case the user re-routes the error handler to not die when Fatal is called
536 }
537 for(int i=0; i<n; ++i) {
538 (*fInsertQuery) += us[i];
539 (*fInsertQuery) += ",";
540 ++fIter;
541 }
542}
543
544////////////////////////////////////////////////////////////////////////////////
545/// WriteFastArray SQL implementation.
546/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
547
549{
550 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
551 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
553 {
554 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
555 return; // In case the user re-routes the error handler to not die when Fatal is called
556 }
557 // std::cerr << "Column: " <<*fIter << " i:" << *ii << std::endl;
558 for(int i=0; i<n; ++i) {
559 (*fInsertQuery) += ii[i];
560 (*fInsertQuery) += ",";
561 ++fIter;
562 }
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// WriteFastArray SQL implementation.
567/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
568
570{
571 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
572 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
574 {
575 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
576 return; // In case the user re-routes the error handler to not die when Fatal is called
577 }
578 for(int i=0; i<n; ++i) {
579 (*fInsertQuery) += ui[i];
580 (*fInsertQuery) += ",";
581 ++fIter;
582 }
583}
584
585////////////////////////////////////////////////////////////////////////////////
586/// WriteFastArray SQL implementation.
587/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
588
590{
591 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
592 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
594 {
595 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
596 return; // In case the user re-routes the error handler to not die when Fatal is called
597 }
598 for(int i=0; i<n; ++i) {
599 (*fInsertQuery)+= l[i];
600 (*fInsertQuery)+= ",";
601 ++fIter;
602 }
603}
604
605////////////////////////////////////////////////////////////////////////////////
606/// WriteFastArray SQL implementation.
607/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
608
610{
611 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
612 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
614 {
615 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
616 return; // In case the user re-routes the error handler to not die when Fatal is called
617 }
618 for(int i=0; i<n; ++i) {
619 (*fInsertQuery) += ul[i];
620 (*fInsertQuery) += ",";
621 ++fIter;
622 }
623}
624
625////////////////////////////////////////////////////////////////////////////////
626/// WriteFastArray SQL implementation.
627/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
628
630{
631 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
632 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
634 {
635 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
636 return; // In case the user re-routes the error handler to not die when Fatal is called
637 }
638 for(int i=0; i<n; ++i) {
639 (*fInsertQuery) += l[i];
640 (*fInsertQuery) += ",";
641 ++fIter;
642 }
643}
644
645////////////////////////////////////////////////////////////////////////////////
646/// WriteFastArray SQL implementation.
647/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
648
650{
651 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
652 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
654 {
655 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
656 return; // In case the user re-routes the error handler to not die when Fatal is called
657 }
658 for(int i=0; i<n; ++i) {
659 (*fInsertQuery) += ul[i];
660 (*fInsertQuery) += ",";
661 ++fIter;
662 }
663}
664
665////////////////////////////////////////////////////////////////////////////////
666/// WriteFastArray SQL implementation.
667/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
668
670{
671 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
672 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
674 {
675 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
676 return; // In case the user re-routes the error handler to not die when Fatal is called
677 }
678 for(int i=0; i<n; ++i) {
679 (*fInsertQuery) += f[i];
680 (*fInsertQuery) += ",";
681 ++fIter;
682 }
683}
684
685////////////////////////////////////////////////////////////////////////////////
686/// WriteFastArray SQL implementation.
687/// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
688
690{
691 constexpr Int_t dataWidth = 2; // at least 2 chars, but could be more.
692 const Int_t maxElements = (std::numeric_limits<Int_t>::max() - Length())/dataWidth;
694 {
695 Fatal("WriteFastArray", "Not enough space left in the buffer (1GB limit). %lld elements is greater than the max left of %d", n, maxElements);
696 return; // In case the user re-routes the error handler to not die when Fatal is called
697 }
698 for(int i=0; i<n; ++i) {
699 (*fInsertQuery) += d[i];
700 (*fInsertQuery )+= ",";
701 ++fIter;
702 }
703}
704
705////////////////////////////////////////////////////////////////////////////////
706/// WriteFastArray SQL implementation.
707// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
708
710{
711 Fatal("WriteFastArray(void*, const TClass*, Long64_t, TMemberStreamer *)","Not implemented yet");
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// WriteFastArray SQL implementation.
716// \note Due to the current limit of the buffer size, the function aborts execution of the program in case of underflow or overflow. See https://github.com/root-project/root/issues/6734 for more details.
717
719{
720 Fatal("WriteFastArray(void **, const TClass*, Long64_t, bool, TMemberStreamer*)","Not implemented yet");
721 return 0;
722}
723
724////////////////////////////////////////////////////////////////////////////////
725/// ReadFastArray SQL implementation.
726
728{
729 for(int i=0; i<n; ++i) {
730 b[i] = (bool)atoi((*fRowPtr)->GetField(*fIter));
731 ++fIter;
732 }
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// ReadFastArray SQL implementation.
737
739{
740 for(int i=0; i<n; ++i) {
741 c[i] = (Char_t)atoi((*fRowPtr)->GetField(*fIter));
742 ++fIter;
743 }
744}
745
746////////////////////////////////////////////////////////////////////////////////
747/// ReadFastArray SQL implementation.
748
750{
751 strcpy(c,((*fRowPtr)->GetField(*fIter)));
752 ++fIter;
753}
754
755////////////////////////////////////////////////////////////////////////////////
756/// ReadFastArray SQL implementation.
757
759{
760 for(int i=0; i<n; ++i) {
761 uc[i] = (UChar_t)atoi((*fRowPtr)->GetField(*fIter));
762 ++fIter;
763 }
764}
765
766////////////////////////////////////////////////////////////////////////////////
767/// ReadFastArray SQL implementation.
768
770{
771 for(int i=0; i<n; ++i) {
772 s[i] = (Short_t)atoi((*fRowPtr)->GetField(*fIter));
773 ++fIter;
774 }
775}
776
777////////////////////////////////////////////////////////////////////////////////
778/// ReadFastArray SQL implementation.
779
781{
782 for(int i=0; i<n; ++i) {
783 us[i] = (UShort_t)atoi((*fRowPtr)->GetField(*fIter));
784 ++fIter;
785 }
786}
787
788////////////////////////////////////////////////////////////////////////////////
789/// ReadFastArray SQL implementation.
790
792{
793 for(int i=0; i<n; ++i) {
794 in[i] = atoi((*fRowPtr)->GetField(*fIter));
795 ++fIter;
796 }
797}
798
799////////////////////////////////////////////////////////////////////////////////
800/// ReadFastArray SQL implementation.
801
803{
804 for(int i=0; i<n; ++i) {
805 ui[i] = atoi((*fRowPtr)->GetField(*fIter));
806 ++fIter;
807 }
808}
809
810////////////////////////////////////////////////////////////////////////////////
811/// ReadFastArray SQL implementation.
812
814{
815 for(int i=0; i<n; ++i) {
816 l[i] = atol((*fRowPtr)->GetField(*fIter));
817 ++fIter;
818 }
819}
820
821////////////////////////////////////////////////////////////////////////////////
822/// ReadFastArray SQL implementation.
823
825{
826 for(int i=0; i<n; ++i) {
827 (*this) >> ul[i];
828 }
829}
830
831////////////////////////////////////////////////////////////////////////////////
832/// ReadFastArray SQL implementation.
833
835{
836 for(int i=0; i<n; ++i) {
837 (*this) >> ll[i];
838 }
839}
840
841////////////////////////////////////////////////////////////////////////////////
842/// ReadFastArray SQL implementation.
843
845{
846 for(int i=0; i<n; ++i) {
847 (*this) >> ull[i];
848 }
849}
850
851////////////////////////////////////////////////////////////////////////////////
852/// ReadFastArray SQL implementation.
853
855{
856 for(int i=0; i<n; ++i) {
857 f[i] = atof((*fRowPtr)->GetField(*fIter));
858 ++fIter;
859 }
860}
861
862////////////////////////////////////////////////////////////////////////////////
863/// ReadFastArray SQL implementation.
864
866{
867 for(int i=0; i<n; ++i) {
868 d[i] = atof((*fRowPtr)->GetField(*fIter));
869 ++fIter;
870 }
871}
872
873////////////////////////////////////////////////////////////////////////////////
874/// ReadFastArray SQL implementation.
875
877{
878 Fatal("ReadFastArrayFloat16(Float_t *, Int_t , TStreamerElement *)","Not implemented yet");
879}
880
881////////////////////////////////////////////////////////////////////////////////
882/// Read array of Float16_t from buffer
883
885{
886 Fatal("ReadFastArrayWithFactor(Float_t *, Int_t, Double_t, Double_t)","Not implemented yet");
887}
888
889////////////////////////////////////////////////////////////////////////////////
890/// Read array of Float16_t from buffer
891
893{
894 Fatal("ReadFastArrayWithNbits(Float_t *, Int_t , Int_t )","Not implemented yet");
895}
896
897////////////////////////////////////////////////////////////////////////////////
898/// Read array of Double32_t from buffer
899
901{
902 Fatal("ReadFastArrayWithFactor(Double_t *, Int_t, Double_t, Double_t)","Not implemented yet");
903}
904
905////////////////////////////////////////////////////////////////////////////////
906/// Read array of Double32_t from buffer
907
909{
910 Fatal("ReadFastArrayWithNbits(Double_t *, Int_t , Int_t )","Not implemented yet");
911}
912
913////////////////////////////////////////////////////////////////////////////////
914/// ReadFastArray SQL implementation.
915
917{
918 Fatal("ReadFastArrayDouble32(Double_t *, Int_t , TStreamerElement *)","Not implemented yet");
919}
920
921////////////////////////////////////////////////////////////////////////////////
922/// ReadFastArray SQL implementation.
923
925{
926 Fatal("ReadFastArray(void *, const TClass *, Int_t, TMemberStreamer *, const TClass *)","Not implemented yet");
927}
928
929////////////////////////////////////////////////////////////////////////////////
930/// ReadFastArray SQL implementation.
931
932void TBufferSQL::ReadFastArray(void **, const TClass *, Int_t, bool, TMemberStreamer *, const TClass *)
933{
934 Fatal("ReadFastArray(void **, const TClass *, Int_t, bool, TMemberStreamer *, const TClass *)","Not implemented yet");
935}
936
937////////////////////////////////////////////////////////////////////////////////
938/// Reset Offset.
939
941{
942 fIter = fColumnVec->begin();
943}
#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
Unsigned Short integer 2 bytes (unsigned short)
Definition RtypesCore.h:54
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char)
Definition RtypesCore.h:52
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:51
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
Definition RtypesCore.h:68
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:53
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
Definition RtypesCore.h:84
#define ClassImp(name)
Definition Rtypes.h:376
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
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
void ReadCharStar(char *&s) override
Read char* from TBuffer.
void WriteCharStar(char *s) override
Write char* into TBuffer.
void WriteStdString(const std::string *s) override
Write std::string to TBuffer.
void ReadStdString(std::string *s) override
Read std::string from TBuffer.
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.
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.
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 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>>
Int_t Length() const
Definition TBuffer.h:100
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1072
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1100
Describe one element (data member) to be Streamed.
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4