24 #ifndef TESSERACT_CCUTIL_KDPAIR_H_ 25 #define TESSERACT_CCUTIL_KDPAIR_H_ 27 #include "genericvector.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_ KDPtrPair(KDPtrPair &src)
Definition: kdpair.h:94
~KDPtrPair()
Definition: kdpair.h:98
static KDPairDec * RecastDataPointer(Data *data_ptr)
Definition: kdpair.h:77
void operator=(KDPtrPairInc &src)
Definition: kdpair.h:151
Data data
Definition: kdpair.h:45
Data * extract_data()
Definition: kdpair.h:131
KDPtrPairDec(Key k, Data *d)
Definition: kdpair.h:166
void operator=(KDPtrPairDec &src)
Definition: kdpair.h:168
Definition: baseapi.cpp:94
const Data * data() const
Definition: kdpair.h:122
int operator==(const KDPair< Key, Data > &other) const
Definition: kdpair.h:38
KDPtrPairInc()
Definition: kdpair.h:148
Data * data_
Definition: kdpair.h:139
KDPairInc(Key k, Data d)
Definition: kdpair.h:53
KDPtrPair(Key k, Data *d)
Definition: kdpair.h:91
const Key & key() const
Definition: kdpair.h:116
Key key_
Definition: kdpair.h:140
int operator==(const KDPtrPair< Key, Data > &other) const
Definition: kdpair.h:111
KDPtrPairDec(KDPtrPairDec &src)
Definition: kdpair.h:167
KDPtrPairInc(KDPtrPairInc &src)
Definition: kdpair.h:150
static KDPairInc * RecastDataPointer(Data *data_ptr)
Definition: kdpair.h:60
void set_data(Data *new_data)
Definition: kdpair.h:126
void operator=(KDPtrPair &src)
Definition: kdpair.h:104
void set_key(const Key &new_key)
Definition: kdpair.h:119
KDPtrPair()
Definition: kdpair.h:90
KDPairDec(Key k, Data d)
Definition: kdpair.h:69
KDPtrPairDec()
Definition: kdpair.h:165
KDPair(Key k, Data d)
Definition: kdpair.h:36
Key key
Definition: kdpair.h:46
KDPtrPairInc(Key k, Data *d)
Definition: kdpair.h:149