20#ifndef TESSERACT_CCUTIL_UNICITY_TABLE_H_
21#define TESSERACT_CCUTIL_UNICITY_TABLE_H_
56 const T &
at(
int id)
const {
69 return table_.get_index(
object);
76 table_.push_back(
object);
85 table_.set_clear_callback(cb);
99 table_.move(&from->table_);
106 bool write(FILE *f, std::function<
bool(FILE *,
const T &)> cb)
const {
107 return table_.write(f, cb);
110 return table_.read(f, cb);
int size() const
Return the size used.
~UnicityTable()
Clear the structures and deallocate internal structures.
void set_clear_callback(std::function< void(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.
bool write(FILE *f, std::function< bool(FILE *, const T &)> cb) const
int get_index(T object) const
void move(UnicityTable< T > *from)
bool read(tesseract::TFile *f, std::function< bool(tesseract::TFile *, T *)> cb)