00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027
00028 #ifndef __REFERENCE_H__
00029 #define __REFERENCE_H__
00030
00031 namespace siscone{
00032
00043 class Creference{
00044 public:
00046 Creference();
00047
00049 void randomize();
00050
00052 bool is_empty();
00053
00055 bool not_empty();
00056
00058 Creference& operator = (const Creference &r);
00059
00061 Creference operator + (const Creference &r);
00062
00064 Creference& operator += (const Creference &r);
00065
00067 Creference& operator -= (const Creference &r);
00068
00070 inline unsigned int operator[] (int i) {return ref[i];}
00071
00072 unsigned int ref[3];
00073 };
00074
00076 Creference operator + (Creference &r1, Creference &r2);
00077
00079 bool operator == (const Creference &r1, const Creference &r2);
00080
00082 bool operator != (const Creference &r1, const Creference &r2);
00083
00085 bool operator < (const Creference &r1, const Creference &r2);
00086
00087
00088
00089
00090
00091
00092 inline bool operator == (const Creference &r1, const Creference &r2){
00093 return (r1.ref[0]==r2.ref[0]) && (r1.ref[1]==r2.ref[1]) && (r1.ref[2]==r2.ref[2]);
00094 }
00095
00096
00097
00098 inline bool operator != (const Creference &r1, const Creference &r2){
00099 return (r1.ref[0]!=r2.ref[0]) || (r1.ref[1]!=r2.ref[1]) || (r1.ref[2]!=r2.ref[2]);
00100 }
00101
00102
00103
00104 inline bool operator < (const Creference &r1, const Creference &r2){
00105 return (r1.ref[0]<r2.ref[0]) || ((r1.ref[0]==r2.ref[0]) &&
00106 ((r1.ref[1]<r2.ref[1]) || ((r1.ref[1]==r2.ref[1]) && (r1.ref[2]<r2.ref[2]))
00107 ));
00108 }
00109
00110 }
00111 #endif