00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019 #ifndef CANDREFER_H
00020 #define CANDREFER_H
00021
00022
00023 #ifndef ROOT_Rtypes
00024 #if !defined(__CINT__) || defined(__MAKECINT__)
00025 #include "Rtypes.h"
00026 #endif
00027 #endif
00028
00029 class CandBase;
00030
00031 class CandRefer
00032 {
00033
00034 public:
00035
00036
00037 CandRefer();
00038 CandRefer(CandBase *ref);
00039 CandRefer(const CandRefer &cr);
00040 virtual ~CandRefer();
00041
00042
00043
00044 CandBase *operator->() {return fRef;}
00045 CandBase& operator*() {return *fRef;}
00046 CandBase* operator()() {return fRef;}
00047
00048
00049 const CandBase* operator->() const {return fRef;}
00050 const CandBase& operator*() const {return *fRef;}
00051 const CandBase* operator()() const {return fRef;}
00052
00053
00054 Bool_t operator==(const CandRefer &cr) const;
00055 Bool_t operator!=(const CandRefer &cr) const;
00056
00057
00058 CandRefer &operator=(const CandRefer &cr);
00059
00060
00061
00062 Int_t GetNRefers() const;
00063
00064
00065 CandBase *OwnRef();
00066
00067
00068
00069 Int_t DecNRefer();
00070
00071
00072 void DropRefer();
00073
00074
00075 Int_t IncNRefer();
00076
00077
00078 void SetRef(CandBase *ref);
00079
00080 private:
00081 CandBase *fRef;
00082
00083 ClassDef(CandRefer,1)
00084
00085 };
00086
00087 #endif // CANDREFER_H