#include <networkscratch.h>
template<typename T>
class tesseract::NetworkScratch::Stack< T >
Definition at line 205 of file networkscratch.h.
◆ Stack()
◆ Borrow()
Definition at line 212 of file networkscratch.h.
213 std::lock_guard<std::mutex> lock(mutex_);
214 if (stack_top_ == stack_.size()) {
215 stack_.push_back(
new T);
218 flags_[stack_top_] =
true;
219 return stack_[stack_top_++];
◆ Return()
Definition at line 226 of file networkscratch.h.
227 std::lock_guard<std::mutex> lock(mutex_);
229 int index = stack_top_ - 1;
230 while (index >= 0 && stack_[index] != item) --index;
231 if (index >= 0) flags_[index] =
false;
232 while (stack_top_ > 0 && !flags_[stack_top_ - 1]) --stack_top_;
The documentation for this class was generated from the following file: