tesseract  5.0.0-alpha-619-ge9db
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_(nullptr) {}

◆ 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_ != nullptr) {
50  other_end_->other_end_ = this;
51  src.other_end_ = nullptr;
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_ != nullptr) {
76  other_end_->other_end_ = nullptr;
77  other_end_ = nullptr;
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_ != nullptr) {
61  other_end_->other_end_ = this;
62  src.other_end_ = nullptr;
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:
tesseract::DoublePtr::Disconnect
void Disconnect()
Definition: doubleptr.h:74