Line data Source code
1 : // Author: Cvetan Cheshkov 27/03/2007
2 :
3 : /**************************************************************************
4 : * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
5 : * *
6 : * Author: The ALICE Off-line Project. *
7 : * Contributors are mentioned in the code where appropriate. *
8 : * *
9 : * Permission to use, copy, modify and distribute this software and its *
10 : * documentation strictly for non-commercial purposes is hereby granted *
11 : * without fee, provided that the above copyright notice appears in all *
12 : * copies and that both the copyright notice and this permission notice *
13 : * appear in the supporting documentation. The authors make no claims *
14 : * about the suitability of this software for any purpose. It is *
15 : * provided "as is" without express or implied warranty. *
16 : **************************************************************************/
17 :
18 : //////////////////////////////////////////////////////////////////////////
19 : // //
20 : // AliRawDataArrayV2 //
21 : // A container object which is used in order to write the sub-detector //
22 : // raw-data payloads into a separate branches //
23 : // //
24 : //////////////////////////////////////////////////////////////////////////
25 :
26 : #include "AliRawDataArrayV2.h"
27 : #include "AliRawData.h"
28 :
29 :
30 128 : ClassImp(AliRawDataArrayV2)
31 :
32 36 : AliRawDataArrayV2::AliRawDataArrayV2():
33 36 : fRawDataArray("AliRawData",100),
34 36 : fNAlloc(0)
35 180 : {
36 : // Default constructor
37 72 : }
38 :
39 52 : AliRawDataArrayV2::AliRawDataArrayV2(Int_t n):
40 52 : fRawDataArray("AliRawData",n),
41 52 : fNAlloc(0)
42 260 : {
43 : // Default constructor
44 104 : }
45 :
46 : AliRawDataArrayV2::~AliRawDataArrayV2()
47 528 : {
48 88 : fRawDataArray.Delete();
49 264 : }
50 :
51 : void AliRawDataArrayV2::ClearData()
52 : {
53 416 : fRawDataArray.Clear();
54 208 : }
55 :
56 : AliRawData *AliRawDataArrayV2::Add()
57 : {
58 3242 : Int_t nEntries = fRawDataArray.GetEntriesFast();
59 1621 : if (nEntries < fNAlloc) {
60 1198 : return (AliRawData *)fRawDataArray[nEntries];
61 : }
62 : else {
63 423 : fNAlloc = nEntries + 1;
64 846 : return new (fRawDataArray[nEntries]) AliRawData();
65 : }
66 1621 : }
|