]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 1 | //////////////////////////////////////////////// |
2 | // RawData classes for set:ITS // | |
3 | //////////////////////////////////////////////// | |
4 | ||
5 | ||
6 | #include "AliITSRawData.h" | |
7 | ||
8 | ClassImp(AliITSRawData) | |
9 | ||
10 | ClassImp(AliITSInStream) | |
11 | ||
12 | //_____________________________________________________________________________ | |
13 | ||
e56160b8 | 14 | AliITSInStream::AliITSInStream(): |
15 | fStreamLen(0), | |
16 | fInStream(0){ | |
b0f5e3fc | 17 | //default constructor |
b0f5e3fc | 18 | } |
19 | //_____________________________________________________________________________ | |
20 | ||
e56160b8 | 21 | AliITSInStream::AliITSInStream(UInt_t length): |
22 | fStreamLen(length), | |
23 | fInStream(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 | //_____________________________________________________________________________ | |
34 | AliITSInStream::~AliITSInStream() | |
35 | { | |
36 | //destructor | |
37 | if (fInStream) delete[] fInStream; | |
38 | } | |
39 | ||
40 | //__________________________________________________________________________ | |
e56160b8 | 41 | AliITSInStream::AliITSInStream(const AliITSInStream &source) : TObject(source), |
42 | fStreamLen(source.fStreamLen), | |
43 | fInStream(source.fInStream){ | |
b0f5e3fc | 44 | // Copy Constructor |
e56160b8 | 45 | |
b0f5e3fc | 46 | } |
47 | ||
48 | //_________________________________________________________________________ | |
49 | AliITSInStream& | |
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 | //_____________________________________________________________________________ | |
59 | void AliITSInStream::ClearStream() | |
60 | { | |
61 | //clear the array | |
62 | memset(fInStream,0,sizeof(UChar_t)*fStreamLen); | |
63 | } | |
64 | ||
65 | ||
66 | //_____________________________________________________________________________ | |
a8a6107b | 67 | Bool_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 | |
77 | ClassImp(AliITSOutStream) | |
78 | ||
79 | //_______________________________________________________________________ | |
80 | ||
e56160b8 | 81 | AliITSOutStream::AliITSOutStream(): |
82 | fStreamLen(0), | |
83 | fOutStream(0){ | |
b0f5e3fc | 84 | //default constructor |
e56160b8 | 85 | |
b0f5e3fc | 86 | } |
87 | ||
88 | //__________________________________________________________________________ | |
89 | ||
e56160b8 | 90 | AliITSOutStream::AliITSOutStream(UInt_t length): |
91 | fStreamLen(length), | |
92 | fOutStream(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 | //_____________________________________________________________________________ | |
103 | AliITSOutStream::~AliITSOutStream() | |
104 | { | |
105 | //destructor | |
106 | if (fOutStream) delete[] fOutStream; | |
107 | } | |
108 | ||
109 | //__________________________________________________________________________ | |
e56160b8 | 110 | AliITSOutStream::AliITSOutStream(const AliITSOutStream &source):TObject(source), |
111 | fStreamLen(source.fStreamLen), | |
112 | fOutStream(source.fOutStream){ | |
b0f5e3fc | 113 | // Copy Constructor |
e56160b8 | 114 | |
b0f5e3fc | 115 | } |
116 | ||
117 | //_________________________________________________________________________ | |
118 | AliITSOutStream& | |
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 | //_____________________________________________________________________________ | |
128 | void AliITSOutStream::ClearStream() | |
129 | { | |
130 | // clear stream | |
a8a6107b | 131 | memset(fOutStream,0,sizeof(UInt_t)*fStreamLen); |
b0f5e3fc | 132 | } |
133 | ||
134 | //_____________________________________________________________________________ | |
a8a6107b | 135 | Bool_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 | } |