23#ifndef TESSERACT_CCUTIL_KDPAIR_H_
24#define TESSERACT_CCUTIL_KDPAIR_H_
32template <
typename Key,
typename Data>
50 const Key &
key()
const {
62template <
typename Key,
typename Data>
68 return this->
key() < other.
key();
73 return reinterpret_cast<KDPairInc *
>(data_ptr);
78template <
typename Key,
typename Data>
85 return this->
key() > other.
key();
90 return reinterpret_cast<KDPairDec *
>(data_ptr);
99template <
typename Key,
typename Data>
112 this->data_ =
nullptr;
118 this->data_ = src.data_;
120 this->key_ = src.key_;
124 return key_ == other.key_;
144 Data *result = data_;
156template <
typename Key,
typename Data>
168 return this->
key() < other.
key();
173template <
typename Key,
typename Data>
186 return this->
key() > other.
key();
int operator==(const KDPair< Key, Data > &other) const
const Data & data() const
int operator<(const KDPairInc< Key, Data > &other) const
static KDPairInc * RecastDataPointer(Data *data_ptr)
static KDPairDec * RecastDataPointer(Data *data_ptr)
int operator<(const KDPairDec< Key, Data > &other) const
void operator=(const KDPtrPair &src)
void set_data(Data *new_data)
const Data * data() const
void set_key(const Key &new_key)
KDPtrPair(const KDPtrPair &src)
int operator==(const KDPtrPair< Key, Data > &other) const
KDPtrPair(Key k, Data *d)
int operator<(const KDPtrPairInc< Key, Data > &other) const
void operator=(const KDPtrPairInc &src)
KDPtrPairInc(const KDPtrPairInc &src)
KDPtrPairInc(Key k, Data *d)
void operator=(const KDPtrPairDec &src)
int operator<(const KDPtrPairDec< Key, Data > &other) const
KDPtrPairDec(const KDPtrPairDec &src)
KDPtrPairDec(Key k, Data *d)