00001
00010 #ifndef __INDEX_HOLDER_H_
00011 #define __INDEX_HOLDER_H_
00012
00013 namespace seq {
00014
00019 template <typename T>
00020 class IndexHolder {
00021 public:
00022 T *value;
00023 unsigned int index;
00024
00027 IndexHolder():value(NULL), index(0) {};
00028 IndexHolder(T *v, unsigned int i) { value = v; index = i;};
00029 ~IndexHolder() {};
00031
00035 static bool lessThan (const IndexHolder<T>& a, const IndexHolder<T>& b) {
00036 return a < b;
00037 }
00038
00041 bool operator < ( IndexHolder<T> const &other) const {
00042 return (*value < *(other.value) );
00043 }
00044
00045 bool operator > ( IndexHolder<T> const &other) const {
00046 return (*value > *(other.value) );
00047 }
00048
00049 bool operator <= ( IndexHolder<T> const &other) const {
00050 return (*value <= *(other.value) );
00051 }
00052
00053 bool operator >= ( IndexHolder<T> const &other) const {
00054 return (*value >= *(other.value) );
00055 }
00056
00057 bool operator == ( IndexHolder<T> const &other) const {
00058 return (*value == *(other.value) );
00059 }
00060
00061 bool operator != ( IndexHolder<T> const &other) const {
00062 return (*value != *(other.value) );
00063 }
00065
00066 };
00067
00068 }
00069
00070 #endif
00071