]>
Commit | Line | Data |
---|---|---|
0de80ab2 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | // $Id$ | |
5 | // $MpId: AliMpArrayI.h,v 1.4 2006/05/24 13:58:07 ivana Exp $ | |
6 | ||
46df088d | 7 | /// \ingroup core |
0de80ab2 | 8 | /// \class AliMpArrayI |
9 | /// \brief Helper class for sorted integer array | |
10 | /// | |
11 | /// \author Ivana Hrivnacova; IPN Orsay | |
12 | ||
13 | #ifndef ALI_MP_ARRAY_I_H | |
14 | #define ALI_MP_ARRAY_I_H | |
15 | ||
3e54ea60 | 16 | #include "AliMpIntPair.h" |
17 | ||
0de80ab2 | 18 | #include <TObject.h> |
19 | #include <TArrayI.h> | |
20 | ||
0de80ab2 | 21 | class TString; |
22 | ||
23 | class AliMpArrayI : public TObject | |
24 | { | |
25 | public: | |
3e54ea60 | 26 | AliMpArrayI(Bool_t sort = true); |
0de80ab2 | 27 | AliMpArrayI(TRootIOCtor* /*ioCtor*/); |
28 | virtual ~AliMpArrayI(); | |
29 | ||
30 | // methods | |
c3882ed0 | 31 | Bool_t Add(Int_t value, Bool_t warn=kTRUE); |
0de80ab2 | 32 | Bool_t Remove(Int_t value); |
ae649dcb | 33 | Bool_t Revert(); |
34 | void Reset(); | |
0de80ab2 | 35 | |
36 | // set methods | |
37 | void SetSize(Int_t size); | |
38 | ||
39 | // get methods | |
40 | Int_t GetSize() const; | |
41 | Int_t GetValue(Int_t index) const; | |
42 | Bool_t HasValue(Int_t value) const; | |
43 | ||
44 | private: | |
45 | // methods | |
46 | Int_t GetPosition(Int_t value) const; | |
47 | ||
48 | // static data members | |
49 | static const Int_t fgkDefaultSize; ///< Default initial size | |
50 | ||
51 | // data members | |
3e54ea60 | 52 | Bool_t fSort; ///< Option to sort the values |
53 | Int_t fNofValues; ///< Number of values in the array | |
54 | TArrayI fValues; ///< Array of values | |
55 | AliMpIntPair fLimits; ///< The minimum and maximum values in the array | |
0de80ab2 | 56 | |
57 | ClassDef(AliMpArrayI,1) // Helper class for sorted integer array | |
58 | }; | |
59 | ||
60 | #endif //ALI_MP_EX_MAP_H | |
61 |