20#ifndef TESSERACT_CCUTIL_UNICITY_TABLE_H_
21#define TESSERACT_CCUTIL_UNICITY_TABLE_H_
56 const T &
at(
int id)
const {
76 return table_.get_index(
object);
83 idx = table_.push_back(
object);
91 table_.set_clear_callback(cb);
105 table_.move(&from->table_);
112 bool write(FILE *f,
const std::function<
bool(FILE *,
const T &)> &cb)
const {
113 return table_.write(f, cb);
116 return table_.read(f, cb);
bool write(FILE *f, const std::function< bool(FILE *, const T &)> &cb) const
T & operator[](size_t id)
int size() const
Return the size used.
~UnicityTable()
Clear the structures and deallocate internal structures.
bool read(tesseract::TFile *f, const std::function< bool(tesseract::TFile *, T *)> &cb)
int push_back(T object)
Add an element in the table.
const T & at(int id) const
Return the object from an id.
int get_index(T object) const
void move(UnicityTable< T > *from)
const T & operator[](size_t id) const
void set_clear_callback(const std::function< void(T)> &cb)