AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpArrayI.h
Go to the documentation of this file.
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 
12 
13 #ifndef ALI_MP_ARRAY_I_H
14 #define ALI_MP_ARRAY_I_H
15 
16 #include <TObject.h>
17 #include <TArrayI.h>
18 
19 class TString;
20 
21 class AliMpArrayI : public TObject
22 {
23  public:
24  AliMpArrayI(Bool_t sort = true);
25  AliMpArrayI(TRootIOCtor* /*ioCtor*/);
26  virtual ~AliMpArrayI();
27 
28  // methods
29  Bool_t Add(Int_t value, Bool_t warn=kTRUE);
30  Bool_t Remove(Int_t value);
31  Bool_t Revert();
32  void Reset();
33 
34  // set methods
35  void SetSize(Int_t size);
36 
37  // get methods
38  Int_t GetSize() const;
39  Int_t GetValue(Int_t index) const;
40  Bool_t HasValue(Int_t value) const;
41 
42  private:
43  // methods
44  Int_t GetPosition(Int_t value) const;
45 
46  // static data members
47  static const Int_t fgkDefaultSize;
48 
49  // data members
50  Bool_t fSort;
51  Int_t fNofValues;
52  TArrayI fValues;
53  Int_t fMinValue;
54  Int_t fMaxValue;
55 
56  ClassDef(AliMpArrayI,2) // Helper class for sorted integer array
57 };
58 
59 #endif //ALI_MP_EX_MAP_H
60 
virtual ~AliMpArrayI()
Definition: AliMpArrayI.cxx:71
Int_t GetSize() const
Int_t fMinValue
The minimum value in the array.
Definition: AliMpArrayI.h:53
Bool_t HasValue(Int_t value) const
Int_t fNofValues
Number of values in the array.
Definition: AliMpArrayI.h:51
Bool_t Add(Int_t value, Bool_t warn=kTRUE)
Definition: AliMpArrayI.cxx:97
AliMpArrayI(Bool_t sort=true)
Definition: AliMpArrayI.cxx:46
Bool_t fSort
Option to sort the values.
Definition: AliMpArrayI.h:50
Bool_t Revert()
void SetSize(Int_t size)
Bool_t Remove(Int_t value)
Helper class for sorted integer array.
Definition: AliMpArrayI.h:21
TArrayI fValues
Array of values.
Definition: AliMpArrayI.h:52
Int_t fMaxValue
The maximum value in the array.
Definition: AliMpArrayI.h:54
Int_t GetValue(Int_t index) const
static const Int_t fgkDefaultSize
Default initial size.
Definition: AliMpArrayI.h:47
Int_t GetPosition(Int_t value) const
Definition: AliMpArrayI.cxx:81