]>
Commit | Line | Data |
---|---|---|
dee1d5f1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
5f91c9e8 | 4 | // $Id$ |
dee1d5f1 | 5 | // $MpId: AliMpIntPair.h,v 1.4 2005/08/26 15:43:36 ivana Exp $ |
6 | ||
7 | /// \ingroup basic | |
8 | /// \class AliMpIntPair | |
9 | /// \brief A pair of integers. | |
10 | /// | |
11 | /// The pair created by the default constructor is in invalide state, | |
12 | /// setting one of values changes the state to valid. | |
13 | /// | |
14 | /// Authors: David Guez, Ivana Hrivnacova; IPN Orsay | |
5f91c9e8 | 15 | |
16 | #ifndef ALI_MP_INT_PAIR_H | |
17 | #define ALI_MP_INT_PAIR_H | |
18 | ||
19 | #include <TObject.h> | |
20 | ||
21 | class AliMpIntPair : public TObject | |
22 | { | |
23 | public: | |
24 | AliMpIntPair(Int_t ix,Int_t iy); | |
25 | AliMpIntPair(Int_t ix,Int_t iy, Bool_t validity); | |
26 | AliMpIntPair(const AliMpIntPair& right); | |
27 | AliMpIntPair(); | |
28 | virtual ~AliMpIntPair(); | |
29 | ||
30 | // operators | |
31 | Bool_t operator < (const AliMpIntPair& pos2) const; | |
32 | Bool_t operator == (const AliMpIntPair& pos2) const; | |
33 | Bool_t operator != (const AliMpIntPair& pos2) const; | |
34 | AliMpIntPair& operator = (const AliMpIntPair& src) ; | |
35 | void operator += (const AliMpIntPair& op); | |
36 | void operator -= (const AliMpIntPair& op); | |
37 | ||
38 | // static get methods | |
39 | static AliMpIntPair Invalid() {return AliMpIntPair();} | |
40 | ||
41 | // get methods | |
42 | Int_t GetFirst() const {return fFirst;} | |
43 | Int_t GetSecond() const {return fSecond;} | |
44 | Bool_t IsValid() const {return fValidity;} | |
45 | ||
46 | // set methods | |
47 | void SetFirst(Int_t ix) {fFirst=ix; fValidity=true; } | |
48 | void SetSecond(Int_t iy) {fSecond=iy; fValidity=true;} | |
49 | ||
50 | private: | |
51 | // data members | |
52 | Int_t fFirst; // position along x | |
53 | Int_t fSecond; // position along y | |
54 | Bool_t fValidity; // validity | |
55 | ||
56 | ClassDef(AliMpIntPair,1) //utility class for the motif type | |
57 | }; | |
58 | ||
59 | AliMpIntPair operator + (const AliMpIntPair& op1,const AliMpIntPair& op2); | |
60 | AliMpIntPair operator - (const AliMpIntPair& op1,const AliMpIntPair& op2); | |
61 | AliMpIntPair operator * (const AliMpIntPair& op1,const AliMpIntPair& op2); | |
62 | ostream& operator << (ostream &stream,const AliMpIntPair& op); | |
63 | ||
64 | #endif //ALI_MP_INT_PAIR_H |