12 #ifndef ROOT_TBufferText
13 #define ROOT_TBufferText
21 class TBufferText :
public TBufferIO {
25 TBufferText(TBuffer::EMode mode, TObject *parent =
nullptr);
28 virtual ~TBufferText();
32 void StreamObject(
void *obj,
const std::type_info &typeinfo,
const TClass *onFileClass =
nullptr)
override;
33 void StreamObject(
void *obj,
const char *className,
const TClass *onFileClass =
nullptr)
override;
34 void StreamObject(TObject *obj)
override;
35 using TBuffer::StreamObject;
37 Int_t ApplySequence(
const TStreamerInfoActions::TActionSequence &sequence,
void *
object)
final;
38 Int_t ApplySequenceVecPtr(
const TStreamerInfoActions::TActionSequence &sequence,
void *start_collection,
39 void *end_collection)
final;
41 ApplySequence(
const TStreamerInfoActions::TActionSequence &sequence,
void *start_collection,
void *end_collection)
final;
43 void ReadFloat16(Float_t *f, TStreamerElement *ele =
nullptr) final;
44 void WriteFloat16(Float_t *f, TStreamerElement *ele =
nullptr) final;
45 void ReadDouble32(Double_t *d, TStreamerElement *ele =
nullptr) final;
46 void WriteDouble32(Double_t *d, TStreamerElement *ele =
nullptr) final;
47 void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue) final;
48 void ReadWithNbits(Float_t *ptr, Int_t nbits) final;
49 void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue) final;
50 void ReadWithNbits(Double_t *ptr, Int_t nbits) final;
52 Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele =
nullptr) override;
53 Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele =
nullptr) override;
55 Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele =
nullptr) final;
56 Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele =
nullptr) final;
58 void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele =
nullptr) final;
59 void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele =
nullptr) final;
60 void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
61 void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits) final;
62 void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue) final;
63 void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) final;
65 void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele =
nullptr) final;
66 void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele =
nullptr) final;
68 void WriteFastArrayFloat16(const Float_t *d, Int_t n, TStreamerElement *ele =
nullptr) final;
69 void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele =
nullptr) final;
72 Int_t ReadClassBuffer(const TClass * ,
void * , const TClass * =
nullptr) override;
73 Int_t ReadClassBuffer(const TClass * ,
void * , Int_t , UInt_t ,
74 UInt_t , const TClass * =
nullptr) override;
75 Int_t WriteClassBuffer(const TClass *cl,
void *pointer) override;
79 Int_t CheckByteCount(UInt_t , UInt_t , const TClass * ) final {
return 0; }
80 Int_t CheckByteCount(UInt_t , UInt_t ,
const char * ) final {
return 0; }
81 void SetByteCount(UInt_t , Bool_t = kFALSE) final {}
82 void SkipVersion(
const TClass *cl =
nullptr) final;
83 Version_t ReadVersionNoCheckSum(UInt_t *, UInt_t *) final {
return 0; }
85 Int_t ReadBuf(
void * , Int_t ) final
87 Error(
"ReadBuf",
"useless in text streamers");
90 void WriteBuf(
const void * , Int_t ) final { Error(
"WriteBuf",
"useless in text streamers"); }
92 char *ReadString(
char * , Int_t ) final
94 Error(
"ReadString",
"useless");
97 void WriteString(
const char * ) final { Error(
"WriteString",
"useless"); }
99 Version_t ReadVersionForMemberWise(
const TClass * =
nullptr) final
101 Error(
"ReadVersionForMemberWise",
"not defined in text-based streamers");
104 UInt_t WriteVersionMemberWise(
const TClass * , Bool_t = kFALSE) final
106 Error(
"WriteVersionMemberWise",
"not defined in text-based streamers");
110 TObject *ReadObject(
const TClass * ) final
112 Error(
"ReadObject",
"not yet implemented for text-based streamers");
117 Int_t ReadClassEmulated(
const TClass * ,
void * ,
const TClass * =
nullptr) final
119 Error(
"ReadClassEmulated",
"not defined in text-based streamers");
123 virtual void WriteBaseClass(
void *start, TStreamerBase *elem);
125 virtual void ReadBaseClass(
void *start, TStreamerBase *elem);
127 static void SetFloatFormat(
const char *fmt =
"%e");
128 static const char *GetFloatFormat();
129 static void SetDoubleFormat(
const char *fmt =
"%.14e");
130 static const char *GetDoubleFormat();
132 static void CompactFloatString(
char *buf,
unsigned len);
133 static const char *ConvertFloat(Float_t v,
char *buf,
unsigned len, Bool_t not_optimize = kFALSE);
134 static const char *ConvertDouble(Double_t v,
char *buf,
unsigned len, Bool_t not_optimize = kFALSE);
137 static const char *fgFloatFmt;
138 static const char *fgDoubleFmt;
140 ClassDefOverride(TBufferText, 0);