00001 00002 // $Id: CandUid.cxx,v 1.3 2003/03/13 23:54:10 gmieg Exp $ 00003 // 00004 // CandUid.cxx 00005 // 00006 // CandUid is the unique ID object for CandBase derived objects. 00007 // 00008 // Author: G. Irwin 3/2000 00010 00011 #include <cassert> 00012 00013 #include "Candidate/CandUid.h" 00014 #include "Candidate/CandBase.h" 00015 00016 ClassImp(CandUid) 00017 00018 //______________________________________________________________________ 00019 CandUid::CandUid() : 00020 fArchUidInt(0) 00021 , fUidInt(0) 00022 { 00023 } 00024 00025 //______________________________________________________________________ 00026 CandUid::CandUid(const CandUid &cu) : 00027 fArchUidInt(0) 00028 , fUidInt(0) 00029 { 00030 fUidInt = cu.GetUidInt(); 00031 fArchUidInt = cu.GetArchUidInt(); 00032 } 00033 00034 //______________________________________________________________________ 00035 CandUid::CandUid(const CandBase &cb) : 00036 fArchUidInt(0) 00037 , fUidInt(0) 00038 { 00039 00040 fUidInt = (UInt_t) &cb; // Set to CandBase address for now 00041 fArchUidInt = fUidInt; 00042 } 00043 00044 //______________________________________________________________________ 00045 CandUid::CandUid(const CandBase &cb, const CandBase &cba) : 00046 fArchUidInt(0) 00047 , fUidInt(0) 00048 { 00049 fUidInt = (UInt_t) &cb; 00050 fArchUidInt = cba.GetArchUidInt(); 00051 } 00052 00053 //______________________________________________________________________ 00054 CandUid::~CandUid() 00055 { 00056 } 00057 00058 //______________________________________________________________________ 00059 CandUid &CandUid::operator=(const CandUid &cu) 00060 { 00061 assert(&cu != 0); 00062 if (this != &cu) fUidInt = cu.GetUidInt(); 00063 return *this; 00064 } 00065 00066 //______________________________________________________________________ 00067 Bool_t CandUid::operator==(const CandUid &cu) const 00068 { 00069 assert(&cu != 0); 00070 return (GetUidInt() == cu.GetUidInt()); 00071 } 00072 00073 //______________________________________________________________________ 00074 Bool_t CandUid::operator!=(const CandUid &cu) const 00075 { 00076 assert(&cu != 0); 00077 return !(*this == cu); 00078 } 00079 00080 //______________________________________________________________________ 00081 Bool_t CandUid::IsCloneOf(const CandUid &cu) const 00082 { 00083 return (GetArchUidInt() == cu.GetArchUidInt()); 00084 }
1.3.9.1