tesseract v5.3.3.20231005
tesseract::DoublePtr Class Reference

#include <doubleptr.h>

Public Member Functions

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

Detailed Description

Definition at line 40 of file doubleptr.h.

Constructor & Destructor Documentation

◆ DoublePtr() [1/2]

tesseract::DoublePtr::DoublePtr ( )
inline

Definition at line 42 of file doubleptr.h.

42: other_end_(nullptr) {}

◆ DoublePtr() [2/2]

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

Definition at line 46 of file doubleptr.h.

46 {
47 other_end_ = src.other_end_;
48 if (other_end_ != nullptr) {
49 other_end_->other_end_ = this;
50 ((DoublePtr &)src).other_end_ = nullptr;
51 }
52 }

Member Function Documentation

◆ Connect()

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

Definition at line 66 of file doubleptr.h.

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

◆ Disconnect()

void tesseract::DoublePtr::Disconnect ( )
inline

Definition at line 73 of file doubleptr.h.

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

◆ operator=()

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

Definition at line 56 of file doubleptr.h.

56 {
57 Disconnect();
58 other_end_ = src.other_end_;
59 if (other_end_ != nullptr) {
60 other_end_->other_end_ = this;
61 ((DoublePtr &)src).other_end_ = nullptr;
62 }
63 }

◆ OtherEnd()

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

Definition at line 80 of file doubleptr.h.

80 {
81 return other_end_;
82 }

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