#include <unicity_table.h>
template<typename T>
class tesseract::UnicityTable< T >
Definition at line 37 of file unicity_table.h.
◆ ~UnicityTable()
Clear the structures and deallocate internal structures.
Definition at line 40 of file unicity_table.h.
◆ at() [1/2]
◆ at() [2/2]
Return the object from an id.
Definition at line 56 of file unicity_table.h.
56 {
57 return table_.at(id);
58 }
◆ clear()
Clear the table, calling the callback function if any. All the owned Callbacks are also deleted. If you don't want the Callbacks to be deleted, before calling clear, set the callback to nullptr.
Definition at line 98 of file unicity_table.h.
98 {
99 table_.clear();
100 }
◆ get_index()
Return the id of the T object. This method NEEDS a compare_callback to be passed to set_compare_callback.
Definition at line 75 of file unicity_table.h.
75 {
76 return table_.get_index(object);
77 }
◆ move()
This method clear the current object, then, does a shallow copy of its argument, and finally invalidate its argument.
Definition at line 104 of file unicity_table.h.
104 {
105 table_.move(&from->table_);
106 }
◆ operator[]() [1/2]
◆ operator[]() [2/2]
◆ push_back()
Add an element in the table.
Definition at line 80 of file unicity_table.h.
80 {
82 if (idx == -1) {
83 idx = table_.push_back(object);
84 }
85 return idx;
86 }
int get_index(T object) const
◆ read()
Definition at line 115 of file unicity_table.h.
115 {
116 return table_.read(f, cb);
117 }
◆ reserve()
Reserve some memory. If there is size or more elements, the table will then allocate size * 2 elements.
Definition at line 46 of file unicity_table.h.
46 {
48 }
int size() const
Return the size used.
◆ set_clear_callback()
Add a callback to be called to delete the elements when the table took their ownership.
Definition at line 90 of file unicity_table.h.
90 {
91 table_.set_clear_callback(cb);
92 }
◆ size()
Return the size used.
Definition at line 51 of file unicity_table.h.
51 {
52 return table_.size();
53 }
◆ write()
Read/Write the table to a file. This does NOT read/write the callbacks. The Callback given must be permanent since they will be called more than once. The given callback will be deleted at the end. Returns false on read/write error.
Definition at line 112 of file unicity_table.h.
112 {
113 return table_.write(f, cb);
114 }
The documentation for this class was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccstruct/fontinfo.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccutil/unicity_table.h