Warning, file /include/root/TArrayC.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TArrayC
0013 #define ROOT_TArrayC
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #include "TArray.h"
0025
0026
0027 class TArrayC : public TArray {
0028
0029 public:
0030 Char_t *fArray;
0031
0032 TArrayC();
0033 TArrayC(Int_t n);
0034 TArrayC(Int_t n, const Char_t *array);
0035 TArrayC(const TArrayC &array);
0036 TArrayC &operator=(const TArrayC &rhs);
0037 virtual ~TArrayC();
0038
0039 void Adopt(Int_t n, Char_t *array);
0040 void AddAt(Char_t c, Int_t i);
0041 Char_t At(Int_t i) const ;
0042 void Copy(TArrayC &array) const {array.Set(fN,fArray);}
0043 const Char_t *GetArray() const { return fArray; }
0044 Char_t *GetArray() { return fArray; }
0045 Double_t GetAt(Int_t i) const override { return At(i); }
0046 Stat_t GetSum() const {Stat_t sum=0; for (Int_t i=0;i<fN;i++) sum+=fArray[i]; return sum;}
0047 void Reset(Char_t val=0) {memset(fArray,val,fN*sizeof(Char_t));}
0048 void Set(Int_t n) override;
0049 void Set(Int_t n, const Char_t *array);
0050 void SetAt(Double_t v, Int_t i) override { AddAt((Char_t)v, i); }
0051 Char_t &operator[](Int_t i);
0052 Char_t operator[](Int_t i) const;
0053
0054 ClassDefOverride(TArrayC,1)
0055 };
0056
0057
0058 #if defined R__TEMPLATE_OVERLOAD_BUG
0059 template <>
0060 #endif
0061 inline TBuffer &operator>>(TBuffer &buf, TArrayC *&obj)
0062 {
0063
0064
0065 obj = (TArrayC *) TArray::ReadArray(buf, TArrayC::Class());
0066 return buf;
0067 }
0068
0069 #if defined R__TEMPLATE_OVERLOAD_BUG
0070 template <>
0071 #endif
0072 inline TBuffer &operator<<(TBuffer &buf, const TArrayC *obj)
0073 {
0074
0075 return buf << (const TArray*)obj;
0076 }
0077
0078 inline Char_t TArrayC::At(Int_t i) const
0079 {
0080 if (!BoundsOk("TArrayC::At", i)) return 0;
0081 return fArray[i];
0082 }
0083
0084 inline Char_t &TArrayC::operator[](Int_t i)
0085 {
0086 if (!BoundsOk("TArrayC::operator[]", i))
0087 i = 0;
0088 return fArray[i];
0089 }
0090
0091 inline Char_t TArrayC::operator[](Int_t i) const
0092 {
0093 if (!BoundsOk("TArrayC::operator[]", i)) return 0;
0094 return fArray[i];
0095 }
0096
0097 #endif