20#ifndef TESSERACT_CCUTIL_UNICITY_TABLE_H_
21#define TESSERACT_CCUTIL_UNICITY_TABLE_H_
47 const T &
get(
int id)
const;
109 compare_cb_(nullptr) {
120 return table_.size();
127 table_.reserve(size);
133 return table_.get(
id);
138 return &(table_.get(
id));
143 return table_.contains_index(
id);
149 return table_.get_index(
object);
155 return get_id(
object) != -1;
161 int idx = get_id(
object);
163 idx = table_.push_back(
object);
172 table_.set_clear_callback(cb);
179 table_.set_compare_callback(cb);
192 return table_.write(f, cb);
198 return table_.read(f, cb);
205 table_.move(&from->table_);
_ConstTessMemberResultCallback_5_0< false, R, T1, P1, P2, P3, P4, P5 >::base * NewPermanentTessCallback(const T1 *obj, R(T2::*member)(P1, P2, P3, P4, P5) const, typename Identity< P1 >::type p1, typename Identity< P2 >::type p2, typename Identity< P3 >::type p3, typename Identity< P4 >::type p4, typename Identity< P5 >::type p5)
void move(UnicityTable< T > *from)
int get_id(T object) const
T contains_id(int id) const
Return true if the id is valid.
bool write(FILE *f, TessResultCallback2< bool, FILE *, T const & > *cb) const
int push_back(T object)
Add an element in the table.
bool read(tesseract::TFile *f, TessResultCallback2< bool, tesseract::TFile *, T * > *cb)
void set_compare_callback(TessResultCallback2< bool, T const &, T const & > *cb)
int size() const
Return the size used.
~UnicityTable()
Clear the structures and deallocate internal structures.
const T & get(int id) const
Return the object from an id.
void set_clear_callback(TessCallback1< T > *cb)
bool contains(T object) const
Return true if T is in the table.