21 #ifndef ADF_BaseBuffer
22 #define ADF_BaseBuffer
23 #define ADF_BASEBUFFER_H ADF_BaseBuffer
82 EEndian GetEndian() {
return fEndian; }
95 {
return gAgent.GetEndian() == e; }
97 {
return gAgent.GetEndian() ; }
99 static Char_t *
New(Char_t *p, Int_t nb = 32*
aKByte);
100 static Short_t *
New(Short_t *p, Int_t nb = 32*
aKByte);
101 static Int_t *
New(Int_t *p, Int_t nb = 32*
aKByte);
102 static UChar_t *
New(UChar_t *p, Int_t nb = 32*
aKByte);
103 static UShort_t *
New(UShort_t *p, Int_t nb = 32*
aKByte);
104 static UInt_t *
New(UInt_t *p, Int_t nb = 32*
aKByte);
105 static Float_t *
New(Float_t *p, Int_t nb = 32*
aKByte);
106 static Double_t *
New(Double_t *p, Int_t nb = 32*
aKByte);
108 static void Zero(Char_t *p, Int_t nb)
109 {
if ( nb < 1 )
return; ::memset(p,0,nb); }
110 static void Zero(Short_t *p, Int_t nb)
111 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Short_t)*nb); }
112 static void Zero(Int_t *p, Int_t nb)
113 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Int_t)*nb); }
114 static void Zero(UChar_t *p, Int_t nb)
115 {
if ( nb < 1 )
return; ::memset(p,0,nb); }
116 static void Zero(UShort_t *p, Int_t nb)
117 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(UShort_t)*nb); }
118 static void Zero(UInt_t *p, Int_t nb)
119 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(UInt_t)*nb); }
120 static void Zero(Float_t *p, Int_t nb)
121 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Float_t)*nb); }
122 static void Zero(Double_t *p, Int_t nb)
123 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Double_t)*nb); }
125 static Char_t *
New(Char_t *p, UInt_t nb );
126 static Short_t *
New(Short_t *p, UInt_t nb );
127 static Int_t *
New(Int_t *p, UInt_t nb );
128 static UChar_t *
New(UChar_t *p, UInt_t nb );
129 static UShort_t *
New(UShort_t *p, UInt_t nb );
130 static UInt_t *
New(UInt_t *p, UInt_t nb );
131 static Float_t *
New(Float_t *p, UInt_t nb );
132 static Double_t *
New(Double_t *p, UInt_t nb );
134 static void Zero(Char_t *p, UInt_t nb)
135 {
if ( nb < 1 )
return; ::memset(p,0,nb); }
136 static void Zero(Short_t *p, UInt_t nb)
137 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Short_t)*nb); }
138 static void Zero(Int_t *p, UInt_t nb)
139 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Int_t)*nb); }
140 static void Zero(UChar_t *p, UInt_t nb)
141 {
if ( nb < 1 )
return; ::memset(p,0,nb); }
142 static void Zero(UShort_t *p, UInt_t nb)
143 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(UShort_t)*nb); }
144 static void Zero(UInt_t *p, UInt_t nb)
145 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(UInt_t)*nb); }
146 static void Zero(Float_t *p, UInt_t nb)
147 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Float_t)*nb); }
148 static void Zero(Double_t *p, UInt_t nb)
149 {
if ( nb < 1 )
return; ::memset(p,0,
sizeof(Double_t)*nb); }
152 {
if ( p ) {
delete [] p; p = NULL;} }
154 {
if ( p ) {
delete [] p; p = NULL;} }
156 {
if ( p ) {
delete [] p; p = NULL;} }
158 {
if ( p ) {
delete [] p; p = NULL;} }
160 {
if ( p ) {
delete [] p; p = NULL;} }
162 {
if ( p ) {
delete [] p; p = NULL;} }
164 {
if ( p ) {
delete [] p; p = NULL;} }
166 {
if ( p ) {
delete [] p; p = NULL;} }
172 static void Copy(
const void *from,
void *to, Int_t
size)
173 {
if ( size > 0 ) ::memcpy(to,from,size); }
174 static void Copy(
const void *from,
void *to, UInt_t
size)
175 {
if ( size > 0 ) ::memcpy(to,from,size); }
184 static void Swap(Short_t, Char_t *);
185 static void Swap(UShort_t, Char_t *);
186 static void Swap(Int_t, Char_t *);
187 static void Swap(UInt_t, Char_t *);
188 static void Swap(Float_t, Char_t *);
189 static void Swap(Double_t, Char_t *);
190 static void Swap(Long64_t, Char_t *);
191 static void Swap(ULong64_t, Char_t *);
192 static void Swap(Long_t, Char_t *);
193 static void Swap(ULong_t, Char_t *);
195 static void Swap(
const Char_t *,Short_t &);
196 static void Swap(
const Char_t *,UShort_t &);
197 static void Swap(
const Char_t *,Int_t &);
198 static void Swap(
const Char_t *,UInt_t &);
199 static void Swap(
const Char_t *,Float_t &);
200 static void Swap(
const Char_t *,Double_t &);
201 static void Swap(
const Char_t *,Long64_t &);
202 static void Swap(
const Char_t *,ULong64_t &);
203 static void Swap(
const Char_t *,Long_t &);
204 static void Swap(
const Char_t *,ULong_t &);
210 {
if ( nb < 1 )
return NULL; p =
new Char_t[nb];
if ( p )
Zero(p,nb);
return p; }
212 {
if ( nb < 1 )
return NULL; p =
new Short_t[nb];
if ( p )
Zero(p,nb);
return p; }
214 {
if ( nb < 1 )
return NULL; p =
new Int_t[nb];
if ( p )
Zero(p,nb);
return p; }
216 {
if ( nb < 1 )
return NULL; p =
new UChar_t[nb];
if ( p )
Zero(p,nb);
return p; }
218 {
if ( nb < 1 )
return NULL; p =
new UShort_t[nb];
if ( p )
Zero(p,nb);
return p; }
220 {
if ( nb < 1 )
return NULL; p =
new UInt_t[nb];
if ( p )
Zero(p,nb);
return p; }
222 {
if ( nb < 1 )
return NULL; p =
new Float_t[nb];
if ( p )
Zero(p,nb);
return p; }
224 {
if ( nb < 1 )
return NULL; p =
new Double_t[nb];
if ( p )
Zero(p,nb);
return p;}
227 {
if ( nb < 1 )
return NULL; p =
new Char_t[nb];
if ( p )
Zero(p,nb);
return p; }
229 {
if ( nb < 1 )
return NULL; p =
new Short_t[nb];
if ( p )
Zero(p,nb);
return p; }
231 {
if ( nb < 1 )
return NULL; p =
new Int_t[nb];
if ( p )
Zero(p,nb);
return p; }
233 {
if ( nb < 1 )
return NULL; p =
new UChar_t[nb];
if ( p )
Zero(p,nb);
return p; }
235 {
if ( nb < 1 )
return NULL; p =
new UShort_t[nb];
if ( p )
Zero(p,nb);
return p; }
237 {
if ( nb < 1 )
return NULL; p =
new UInt_t[nb];
if ( p )
Zero(p,nb);
return p; }
239 {
if ( nb < 1 )
return NULL; p =
new Float_t[nb];
if ( p )
Zero(p,nb);
return p; }
241 {
if ( nb < 1 )
return NULL; p =
new Double_t[nb];
if ( p )
Zero(p,nb);
return p; }
246 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
247 *((UShort_t *)buf) = Rbswap_16(x);
250 const UShort_t *intermediary = &x;
251 char *sw = (
char *) intermediary;
261 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
262 *((UInt_t *)buf) = Rbswap_32(x);
265 const UInt_t *intermediary = &x;
266 char *sw = (
char *)intermediary;
278 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
284 *((UInt_t *)buf) = Rbswap_32(u.i);
300 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
302 volatile ULong64_t l;
306 *((ULong64_t *)buf) = Rbswap_64(u.l);
326 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
327 *((ULong64_t *)buf) = Rbswap_64(x);
330 const ULong64_t *intermediary = &x;
331 char *sw = (
char *)intermediary;
347 const Long_t *intermediary = &x;
348 char *sw = (
char *)intermediary;
349 if (
sizeof(Long_t) == 8) {
379 const ULong_t *intermediary = &x;
380 char *sw = (
char *)intermediary;
381 if (
sizeof(ULong_t) == 8) {
404 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
405 x = Rbswap_16(*((UShort_t *)buf));
407 char *sw = (
char *)&x;
415 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
416 x = Rbswap_16(*((Short_t *)buf));
418 char *sw = (
char *)&x;
426 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
427 x = Rbswap_32(*((UInt_t *)buf));
429 char *sw = (
char *)&x;
439 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
440 x = Rbswap_32(*((Int_t *)buf));
442 char *sw = (
char *)&x;
451 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
457 u.i = Rbswap_32(*((UInt_t *)buf));
474 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
477 volatile ULong64_t l;
480 u.l = Rbswap_64(*((ULong64_t *)buf));
504 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
505 x = Rbswap_64(*((ULong64_t *)buf));
507 char *sw = (
char *)&x;
521 # if ADF_STANDALONE == 0 && defined(R__USEASMSWAP)
522 x = Rbswap_64(*((Long64_t *)buf));
524 char *sw = (
char *)&x;
538 char *sw = (
char *)&x;
539 if (
sizeof(ULong_t) == 8) {
558 char *sw = (
char *)&x;
559 if (
sizeof(Long_t) == 8) {
static void Delete(UInt_t *p)
static void Delete(Int_t *p)
static void Zero(Int_t *p, Int_t nb)
static void Zero(Int_t *p, UInt_t nb)
static void Delete(Float_t *p)
static void Delete(Char_t *p)
static void Swap(Short_t, Char_t *)
the Swap members
static void Zero(UShort_t *p, UInt_t nb)
static void Zero(UInt_t *p, Int_t nb)
static void Zero(Char_t *p, Int_t nb)
static void Zero(Short_t *p, Int_t nb)
static void Zero(Float_t *p, UInt_t nb)
static void Delete(UShort_t *p)
static bool IsSysEndian(BaseBuffer::EEndian e)
check out the endian type of the running system
static EEndian SysEndian()
static void Copy(const void *from, void *to, Int_t size)
copy the content from -> to
static void Zero(UInt_t *p, UInt_t nb)
static void Zero(Double_t *p, Int_t nb)
static void Zero(Double_t *p, UInt_t nb)
static void Zero(Float_t *p, Int_t nb)
static void Zero(Char_t *p, UInt_t nb)
to set informations about the ADF configuration
static void Copy(const void *from, void *to, UInt_t size)
static void Zero(Short_t *p, UInt_t nb)
static void Zero(UChar_t *p, Int_t nb)
static Char_t * New(Char_t *p, Int_t nb=32 *aKByte)
static void Zero(UShort_t *p, Int_t nb)
static void Delete(Short_t *p)
static void Delete(Double_t *p)
static void Delete(UChar_t *p)
static void Zero(UChar_t *p, UInt_t nb)
EStatus
Status for this buffer.