24 #ifndef TESSERACT_CCUTIL_KDPAIR_H_ 25 #define TESSERACT_CCUTIL_KDPAIR_H_ 33 template <
typename Key,
typename Data>
50 template <
typename Key,
typename Data>
55 int operator<(const KDPairInc<Key, Data>& other)
const {
56 return this->
key < other.key;
61 return reinterpret_cast<KDPairInc*
>(data_ptr);
66 template <
typename Key,
typename Data>
72 int operator<(const KDPairDec<Key, Data>& other)
const {
73 return this->
key > other.key;
78 return reinterpret_cast<KDPairDec*
>(data_ptr);
87 template <
typename Key,
typename Data>
100 this->data_ =
nullptr;
106 this->data_ = src.data_;
108 this->key_ = src.key_;
112 return key_ == other.key_;
132 Data* result = data_;
144 template <
typename Key,
typename Data>
155 int operator<(const KDPtrPairInc<Key, Data>& other)
const {
156 return this->
key() < other.key();
161 template <
typename Key,
typename Data>
173 int operator<(const KDPtrPairDec<Key, Data>& other)
const {
174 return this->
key() > other.key();
189 #endif // TESSERACT_CCUTIL_KDPAIR_H_ KDPtrPairInc(Key k, Data *d)
int operator==(const KDPair< Key, Data > &other) const
KDPtrPairInc(KDPtrPairInc &src)
const Data * data() const
static KDPairInc * RecastDataPointer(Data *data_ptr)
void operator=(KDPtrPairDec &src)
KDPtrPairDec(Key k, Data *d)
void operator=(KDPtrPair &src)
void operator=(KDPtrPairInc &src)
void set_data(Data *new_data)
int operator==(const KDPtrPair< Key, Data > &other) const
KDPtrPair(KDPtrPair &src)
KDPtrPair(Key k, Data *d)
void set_key(const Key &new_key)
static KDPairDec * RecastDataPointer(Data *data_ptr)
KDPtrPairDec(KDPtrPairDec &src)