00001 // -*- C++ -*- 00002 #ifndef PYTHIA7_OrientedIndex_H 00003 #define PYTHIA7_OrientedIndex_H 00004 // This is the declaration of the OrientedIndex class. 00005 00006 #include "Pythia7/Config/Pythia7.h" 00007 // #include "OrientedIndex.fh" 00008 // #include "OrientedIndex.xh" 00009 #include "Oriented.h" 00010 00011 00012 00013 namespace Pythia7 { 00014 00015 00033 class OrientedIndex: public Oriented{ 00034 00035 public: 00036 00040 inline OrientedIndex(int ii=0): Idx(ii){} 00041 00045 inline OrientedIndex(const OrientedIndex& OI): Idx(OI.Idx){} 00046 00050 inline void operator=(const OrientedIndex& OI){ 00051 Idx = OI.Idx; 00052 } 00053 00057 inline OrientedIndex& operator=(int ii) { 00058 Idx = ii; 00059 return *this; 00060 } 00061 00065 inline int operator++() { 00066 return (Oriented::Dir()==Oriented::right)? ++Idx: --Idx; 00067 } 00068 00072 inline int operator++(int) { 00073 return (Oriented::Dir()==Oriented::right)? Idx++: Idx--; 00074 } 00075 00079 inline bool operator==(int ii) { 00080 return (Idx ==ii); 00081 } 00082 00086 inline bool operator!=(int ii) const { 00087 return (Idx !=ii); 00088 } 00089 00093 inline bool operator < (int ii) const { 00094 return (Oriented::Dir()==Oriented::right)? 00095 (Idx < ii) : (ii < Idx); 00096 } 00097 00101 inline bool operator <= (int ii) const { 00102 return (Oriented::Dir()==Oriented::right)? 00103 (Idx <= ii) : (ii <= Idx); 00104 } 00105 00109 inline bool operator < (const OrientedIndex& OI) const { 00110 return (Oriented::Dir()==Oriented::right)? 00111 (Idx < OI.idx()) : (OI.idx() < Idx); 00112 } 00113 00117 inline bool operator <= (const OrientedIndex& OI) const { 00118 return (Oriented::Dir()==Oriented::right)? 00119 (Idx <= OI.idx()) : (OI.idx() <= Idx); 00120 } 00121 00125 inline OrientedIndex operator-() { 00126 return OrientedIndex(-Idx); 00127 } 00128 00132 inline int idx()const { 00133 return Idx; 00134 } 00135 00139 inline operator int() const{ 00140 return idx(); 00141 } 00142 00143 private : 00144 00148 int Idx; 00149 00150 }; 00151 00152 } 00153 00154 //#include "OrientedIndex.icc" 00155 #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE 00156 // #include "OrientedIndex.tcc" 00157 #endif 00158 00159 #endif /* PYTHIA7_OrientedIndex_H */