// RawData classes for set:ITS //
////////////////////////////////////////////////
-
+#include <cstring>
#include "AliITSRawData.h"
ClassImp(AliITSRawData)
//_____________________________________________________________________________
-AliITSInStream::AliITSInStream()
-{
+AliITSInStream::AliITSInStream():
+fStreamLen(0),
+fInStream(0){
//default constructor
- fStreamLen=0;
- fInStream=0;
}
//_____________________________________________________________________________
-AliITSInStream::AliITSInStream(ULong_t length)
-{
+AliITSInStream::AliITSInStream(UInt_t length):
+fStreamLen(length),
+fInStream(0){
//
// Creates a stream of unsigned chars
//
- fStreamLen = length;
- fInStream = new UChar_t[length];
-
+ fInStream = new UChar_t[length];
ClearStream();
}
}
//__________________________________________________________________________
-AliITSInStream::AliITSInStream(const AliITSInStream &source){
+AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source),
+fStreamLen(source.fStreamLen),
+fInStream(source.fInStream){
// Copy Constructor
- if(&source == this) return;
- this->fStreamLen = source.fStreamLen;
- this->fInStream = source.fInStream;
- return;
+
}
//_________________________________________________________________________
//_____________________________________________________________________________
-Bool_t AliITSInStream::CheckCount(ULong_t count) {
+Bool_t AliITSInStream::CheckCount(UInt_t count) {
//check boundaries
- if (count <= (ULong_t)fStreamLen) return kTRUE;
+ if (count <= (UInt_t)fStreamLen) return kTRUE;
else {
Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
return kFALSE;
}
}
-//____________________________________________________________________________
-void AliITSInStream::Streamer(TBuffer &R__b){
- // Stream an object of class AliITSInStream.
-
- static unsigned char *array;
- static Bool_t make=kTRUE;
-
- if (R__b.IsReading()) {
- R__b >> fStreamLen;
- //printf("Streamer: fStreamLen %d\n",fStreamLen);
- if (make) array=new unsigned char[fStreamLen];
- make=kFALSE;
- memset(array,0,sizeof(UChar_t)*fStreamLen);
- fInStream=array;
- R__b.ReadFastArray(fInStream,fStreamLen);
-
- } else {
- R__b << fStreamLen;
- R__b.WriteFastArray(fInStream,fStreamLen);
- }
-}
-
-
ClassImp(AliITSOutStream)
//_______________________________________________________________________
- AliITSOutStream::AliITSOutStream() {
+AliITSOutStream::AliITSOutStream():
+fStreamLen(0),
+fOutStream(0){
//default constructor
- fStreamLen=0;
- fOutStream=0;
+
}
//__________________________________________________________________________
-AliITSOutStream::AliITSOutStream(ULong_t length) {
+AliITSOutStream::AliITSOutStream(UInt_t length):
+fStreamLen(length),
+fOutStream(0){
//
// Creates a stream of unsigned chars
//
- fStreamLen = length;
- fOutStream = new ULong_t[length];
+ fOutStream = new UInt_t[length];
ClearStream();
}
}
//__________________________________________________________________________
-AliITSOutStream::AliITSOutStream(const AliITSOutStream &source){
+AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source),
+fStreamLen(source.fStreamLen),
+fOutStream(source.fOutStream){
// Copy Constructor
- if(&source == this) return;
- this->fStreamLen = source.fStreamLen;
- this->fOutStream = source.fOutStream;
- return;
+
}
//_________________________________________________________________________
void AliITSOutStream::ClearStream()
{
// clear stream
- memset(fOutStream,0,sizeof(ULong_t)*fStreamLen);
+ memset(fOutStream,0,sizeof(UInt_t)*fStreamLen);
}
//_____________________________________________________________________________
-Bool_t AliITSOutStream::CheckCount(ULong_t count)
+Bool_t AliITSOutStream::CheckCount(UInt_t count)
{
//check boundaries
if (count < fStreamLen) return kTRUE;
return kFALSE;
}
}
-
-//____________________________________________________________________________
-void AliITSOutStream::Streamer(TBuffer &R__b){
-
- // Stream an object of class AliITSOutStream.
-
- static unsigned long *array;
- static Bool_t make=kTRUE;
-
- if (R__b.IsReading()) {
- R__b >> fStreamLen;
- //printf("Streamer: fStreamLen %d\n",fStreamLen);
- if (make) array=new unsigned long[fStreamLen];
- make=kFALSE;
- memset(array,0,sizeof(ULong_t)*fStreamLen);
- fOutStream=array;
- R__b.ReadFastArray(fOutStream,fStreamLen);
-
- } else {
- R__b << fStreamLen;
- R__b.WriteFastArray(fOutStream,fStreamLen);
- }
-}
-