tesseract  5.0.0-alpha-619-ge9db
tesseract::NetworkScratch::FloatVec Class Reference

#include <networkscratch.h>

Public Member Functions

 FloatVec (int size, NetworkScratch *scratch)
 
 FloatVec ()
 
 ~FloatVec ()
 
void Init (int size, NetworkScratch *scratch)
 
 operator double * () const
 
double * get ()
 

Detailed Description

Definition at line 134 of file networkscratch.h.

Constructor & Destructor Documentation

◆ FloatVec() [1/2]

tesseract::NetworkScratch::FloatVec::FloatVec ( int  size,
NetworkScratch scratch 
)
inline

Definition at line 137 of file networkscratch.h.

138  : vec_(nullptr), scratch_space_(scratch) {
139  Init(size, scratch);
140  }

◆ FloatVec() [2/2]

tesseract::NetworkScratch::FloatVec::FloatVec ( )
inline

Definition at line 142 of file networkscratch.h.

142 : vec_(nullptr), data_(nullptr), scratch_space_(nullptr) {}

◆ ~FloatVec()

tesseract::NetworkScratch::FloatVec::~FloatVec ( )
inline

Definition at line 143 of file networkscratch.h.

143  {
144  if (scratch_space_ != nullptr) scratch_space_->vec_stack_.Return(vec_);
145  }

Member Function Documentation

◆ get()

double* tesseract::NetworkScratch::FloatVec::get ( )
inline

Definition at line 159 of file networkscratch.h.

159 { return data_; }

◆ Init()

void tesseract::NetworkScratch::FloatVec::Init ( int  size,
NetworkScratch scratch 
)
inline

Definition at line 147 of file networkscratch.h.

147  {
148  if (scratch_space_ != nullptr && vec_ != nullptr)
149  scratch_space_->vec_stack_.Return(vec_);
150  scratch_space_ = scratch;
151  vec_ = scratch_space_->vec_stack_.Borrow();
152  vec_->resize_no_init(size);
153  data_ = &(*vec_)[0];
154  }

◆ operator double *()

tesseract::NetworkScratch::FloatVec::operator double * ( ) const
inline

Definition at line 158 of file networkscratch.h.

158 { return data_; }

The documentation for this class was generated from the following file:
tesseract::NetworkScratch::Stack::Borrow
T * Borrow()
Definition: networkscratch.h:212
tesseract::NetworkScratch::Stack::Return
void Return(T *item)
Definition: networkscratch.h:226
GenericVector::resize_no_init
void resize_no_init(int size)
Definition: genericvector.h:65
tesseract::NetworkScratch::FloatVec::Init
void Init(int size, NetworkScratch *scratch)
Definition: networkscratch.h:147