tesseract  4.00.00dev
tesseract::DoublePtr Class Reference

#include <doubleptr.h>

Public Member Functions

 DoublePtr ()
 
 DoublePtr (DoublePtr &src)
 
void operator= (DoublePtr &src)
 
void Connect (DoublePtr *other)
 
void Disconnect ()
 
DoublePtrOtherEnd () const
 

Detailed Description

Definition at line 41 of file doubleptr.h.

Constructor & Destructor Documentation

◆ DoublePtr() [1/2]

tesseract::DoublePtr::DoublePtr ( )
inline

Definition at line 43 of file doubleptr.h.

43 : other_end_(NULL) {}

◆ DoublePtr() [2/2]

tesseract::DoublePtr::DoublePtr ( DoublePtr src)
inline

Definition at line 47 of file doubleptr.h.

47  {
48  other_end_ = src.other_end_;
49  if (other_end_ != NULL) {
50  other_end_->other_end_ = this;
51  src.other_end_ = NULL;
52  }
53  }

Member Function Documentation

◆ Connect()

void tesseract::DoublePtr::Connect ( DoublePtr other)
inline

Definition at line 67 of file doubleptr.h.

67  {
68  other->Disconnect();
69  Disconnect();
70  other->other_end_ = this;
71  other_end_ = other;
72  }

◆ Disconnect()

void tesseract::DoublePtr::Disconnect ( )
inline

Definition at line 74 of file doubleptr.h.

74  {
75  if (other_end_ != NULL) {
76  other_end_->other_end_ = NULL;
77  other_end_ = NULL;
78  }
79  }

◆ operator=()

void tesseract::DoublePtr::operator= ( DoublePtr src)
inline

Definition at line 57 of file doubleptr.h.

57  {
58  Disconnect();
59  other_end_ = src.other_end_;
60  if (other_end_ != NULL) {
61  other_end_->other_end_ = this;
62  src.other_end_ = NULL;
63  }
64  }

◆ OtherEnd()

DoublePtr* tesseract::DoublePtr::OtherEnd ( ) const
inline

Definition at line 81 of file doubleptr.h.

81  {
82  return other_end_;
83  }

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