tesseract  4.0.0-1-g2a2b
tesseract::KDPtrPair< Key, Data > Class Template Reference

#include <kdpair.h>

Inheritance diagram for tesseract::KDPtrPair< Key, Data >:
tesseract::KDPtrPairDec< Key, Data > tesseract::KDPtrPairInc< Key, Data >

Public Member Functions

 KDPtrPair ()
 
 KDPtrPair (Key k, Data *d)
 
 KDPtrPair (KDPtrPair &src)
 
 ~KDPtrPair ()
 
void operator= (KDPtrPair &src)
 
int operator== (const KDPtrPair< Key, Data > &other) const
 
const Key & key () const
 
void set_key (const Key &new_key)
 
const Data * data () const
 
void set_data (Data *new_data)
 
Data * extract_data ()
 

Detailed Description

template<typename Key, typename Data>
class tesseract::KDPtrPair< Key, Data >

Definition at line 88 of file kdpair.h.

Constructor & Destructor Documentation

◆ KDPtrPair() [1/3]

template<typename Key, typename Data>
tesseract::KDPtrPair< Key, Data >::KDPtrPair ( )
inline

Definition at line 90 of file kdpair.h.

90 : data_(nullptr) {}

◆ KDPtrPair() [2/3]

template<typename Key, typename Data>
tesseract::KDPtrPair< Key, Data >::KDPtrPair ( Key  k,
Data *  d 
)
inline

Definition at line 91 of file kdpair.h.

91 : data_(d), key_(k) {}

◆ KDPtrPair() [3/3]

template<typename Key, typename Data>
tesseract::KDPtrPair< Key, Data >::KDPtrPair ( KDPtrPair< Key, Data > &  src)
inline

Definition at line 94 of file kdpair.h.

94  : data_(src.data_), key_(src.key_) {
95  src.data_ = nullptr;
96  }

◆ ~KDPtrPair()

template<typename Key, typename Data>
tesseract::KDPtrPair< Key, Data >::~KDPtrPair ( )
inline

Definition at line 98 of file kdpair.h.

98  {
99  delete this->data_;
100  this->data_ = nullptr;
101  }

Member Function Documentation

◆ data()

template<typename Key, typename Data>
const Data* tesseract::KDPtrPair< Key, Data >::data ( ) const
inline

Definition at line 122 of file kdpair.h.

122  {
123  return data_;
124  }

◆ extract_data()

template<typename Key, typename Data>
Data* tesseract::KDPtrPair< Key, Data >::extract_data ( )
inline

Definition at line 131 of file kdpair.h.

131  {
132  Data* result = data_;
133  data_ = nullptr;
134  return result;
135  }

◆ key()

template<typename Key, typename Data>
const Key& tesseract::KDPtrPair< Key, Data >::key ( ) const
inline

Definition at line 116 of file kdpair.h.

116  {
117  return key_;
118  }

◆ operator=()

template<typename Key, typename Data>
void tesseract::KDPtrPair< Key, Data >::operator= ( KDPtrPair< Key, Data > &  src)
inline

Definition at line 104 of file kdpair.h.

104  {
105  delete this->data_;
106  this->data_ = src.data_;
107  src.data_ = nullptr;
108  this->key_ = src.key_;
109  }

◆ operator==()

template<typename Key, typename Data>
int tesseract::KDPtrPair< Key, Data >::operator== ( const KDPtrPair< Key, Data > &  other) const
inline

Definition at line 111 of file kdpair.h.

111  {
112  return key_ == other.key_;
113  }

◆ set_data()

template<typename Key, typename Data>
void tesseract::KDPtrPair< Key, Data >::set_data ( Data *  new_data)
inline

Definition at line 126 of file kdpair.h.

126  {
127  delete data_;
128  data_ = new_data;
129  }

◆ set_key()

template<typename Key, typename Data>
void tesseract::KDPtrPair< Key, Data >::set_key ( const Key &  new_key)
inline

Definition at line 119 of file kdpair.h.

119  {
120  key_ = new_key;
121  }

The documentation for this class was generated from the following file: