Added two missing includes to allow macro compilation (thanks to Laurent for remarkin...
[u/mrichter/AliRoot.git] / ITS / AliITSRawData.cxx
CommitLineData
b0f5e3fc 1////////////////////////////////////////////////
2// RawData classes for set:ITS //
3////////////////////////////////////////////////
4
29e923a3 5#include <cstring>
b0f5e3fc 6#include "AliITSRawData.h"
7
8ClassImp(AliITSRawData)
9
10ClassImp(AliITSInStream)
11
12//_____________________________________________________________________________
13
e56160b8 14AliITSInStream::AliITSInStream():
15fStreamLen(0),
16fInStream(0){
b0f5e3fc 17 //default constructor
b0f5e3fc 18}
19//_____________________________________________________________________________
20
e56160b8 21AliITSInStream::AliITSInStream(UInt_t length):
22fStreamLen(length),
23fInStream(0){
b0f5e3fc 24 //
25 // Creates a stream of unsigned chars
26 //
27
e56160b8 28 fInStream = new UChar_t[length];
b0f5e3fc 29 ClearStream();
30
31}
32
33//_____________________________________________________________________________
34AliITSInStream::~AliITSInStream()
35{
36 //destructor
37 if (fInStream) delete[] fInStream;
38}
39
40//__________________________________________________________________________
e56160b8 41AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source),
42fStreamLen(source.fStreamLen),
43fInStream(source.fInStream){
b0f5e3fc 44 // Copy Constructor
e56160b8 45
b0f5e3fc 46}
47
48//_________________________________________________________________________
49AliITSInStream&
50 AliITSInStream::operator=(const AliITSInStream &source) {
51 // Assignment operator
52 if(&source == this) return *this;
53 this->fStreamLen = source.fStreamLen;
54 this->fInStream = source.fInStream;
55 return *this;
56}
57
58//_____________________________________________________________________________
59void AliITSInStream::ClearStream()
60{
61 //clear the array
62 memset(fInStream,0,sizeof(UChar_t)*fStreamLen);
63}
64
65
66//_____________________________________________________________________________
a8a6107b 67Bool_t AliITSInStream::CheckCount(UInt_t count) {
b0f5e3fc 68 //check boundaries
a8a6107b 69 if (count <= (UInt_t)fStreamLen) return kTRUE;
b0f5e3fc 70 else {
71 Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
72 return kFALSE;
73 }
74}
75
b0f5e3fc 76
77ClassImp(AliITSOutStream)
78
79 //_______________________________________________________________________
80
e56160b8 81AliITSOutStream::AliITSOutStream():
82fStreamLen(0),
83fOutStream(0){
b0f5e3fc 84 //default constructor
e56160b8 85
b0f5e3fc 86}
87
88//__________________________________________________________________________
89
e56160b8 90AliITSOutStream::AliITSOutStream(UInt_t length):
91fStreamLen(length),
92fOutStream(0){
b0f5e3fc 93 //
94 // Creates a stream of unsigned chars
95 //
96
a8a6107b 97 fOutStream = new UInt_t[length];
b0f5e3fc 98 ClearStream();
99
100}
101
102//_____________________________________________________________________________
103AliITSOutStream::~AliITSOutStream()
104{
105 //destructor
106 if (fOutStream) delete[] fOutStream;
107}
108
109//__________________________________________________________________________
e56160b8 110AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source),
111fStreamLen(source.fStreamLen),
112fOutStream(source.fOutStream){
b0f5e3fc 113 // Copy Constructor
e56160b8 114
b0f5e3fc 115}
116
117//_________________________________________________________________________
118AliITSOutStream&
119 AliITSOutStream::operator=(const AliITSOutStream &source) {
120 // Assignment operator
121 if(&source == this) return *this;
122 this->fStreamLen = source.fStreamLen;
123 this->fOutStream = source.fOutStream;
124 return *this;
125}
126
127//_____________________________________________________________________________
128void AliITSOutStream::ClearStream()
129{
130 // clear stream
a8a6107b 131 memset(fOutStream,0,sizeof(UInt_t)*fStreamLen);
b0f5e3fc 132}
133
134//_____________________________________________________________________________
a8a6107b 135Bool_t AliITSOutStream::CheckCount(UInt_t count)
b0f5e3fc 136{
137 //check boundaries
138 if (count < fStreamLen) return kTRUE;
139 else {
140 Error("CheckCount", "actual size is %d, the necessary size is %d",fStreamLen,count);
141 return kFALSE;
142 }
143}