tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
tesseract::DawgPositionVector Class Reference

#include <dawg.h>

Inheritance diagram for tesseract::DawgPositionVector:
Collaboration diagram for tesseract::DawgPositionVector:

Public Member Functions

void clear ()
 
bool add_unique (const DawgPosition &new_pos, bool debug, const char *debug_msg)
 
- Public Member Functions inherited from GenericVector< DawgPosition >
 GenericVector ()
 
 GenericVector (int size, const DawgPosition &init_val)
 
 GenericVector (const GenericVector &other)
 
GenericVector< DawgPosition > & operator+= (const GenericVector &other)
 
void operator+= (const DawgPosition &t)
 
GenericVector< DawgPosition > & operator= (const GenericVector &other)
 
 ~GenericVector ()
 
void reserve (int size)
 
void double_the_size ()
 
void init_to_size (int size, const DawgPosition &t)
 
void resize_no_init (int size)
 
int size () const
 
size_t unsigned_size () const
 
int size_reserved () const
 
int length () const
 
bool empty () const
 
DawgPosition & get (int index) const
 
DawgPosition & back () const
 
DawgPosition & operator[] (int index) const
 
DawgPosition pop_back ()
 
int get_index (const DawgPosition &object) const
 
bool contains (const DawgPosition &object) const
 
DawgPosition contains_index (int index) const
 
int push_back (DawgPosition object)
 
int push_back_new (const DawgPosition &object)
 
int push_front (const DawgPosition &object)
 
void set (const DawgPosition &t, int index)
 
void insert (const DawgPosition &t, int index)
 
void remove (int index)
 
void truncate (int size)
 
void set_clear_callback (TessCallback1< DawgPosition > *cb)
 
void set_compare_callback (TessResultCallback2< bool, DawgPosition const &, DawgPosition const & > *cb)
 
void clear ()
 
void delete_data_pointers ()
 
void move (GenericVector< DawgPosition > *from)
 
bool write (FILE *f, TessResultCallback2< bool, FILE *, DawgPosition const & > *cb) const
 
bool read (tesseract::TFile *f, TessResultCallback2< bool, tesseract::TFile *, DawgPosition * > *cb)
 
bool Serialize (FILE *fp) const
 
bool Serialize (tesseract::TFile *fp) const
 
bool DeSerialize (bool swap, FILE *fp)
 
bool DeSerialize (tesseract::TFile *fp)
 
bool SerializeClasses (FILE *fp) const
 
bool SerializeClasses (tesseract::TFile *fp) const
 
bool DeSerializeClasses (bool swap, FILE *fp)
 
bool DeSerializeClasses (tesseract::TFile *fp)
 
void reverse ()
 
void sort ()
 
void sort (int(*comparator)(const void *, const void *))
 
bool bool_binary_search (const DawgPosition &target) const
 
int binary_search (const DawgPosition &target) const
 
void compact_sorted ()
 
void compact (TessResultCallback1< bool, int > *delete_cb)
 
DawgPosition dot_product (const GenericVector< DawgPosition > &other) const
 
int choose_nth_item (int target_index)
 
void swap (int index1, int index2)
 
bool WithinBounds (const DawgPosition &rangemin, const DawgPosition &rangemax) const
 

Additional Inherited Members

- Static Public Member Functions inherited from GenericVector< DawgPosition >
static bool SkipDeSerialize (tesseract::TFile *fp)
 
static bool SkipDeSerializeClasses (tesseract::TFile *fp)
 
static DawgPosition * double_the_size_memcpy (int current_size, DawgPosition *data)
 
- Protected Member Functions inherited from GenericVector< DawgPosition >
int choose_nth_item (int target_index, int start, int end, unsigned int *seed)
 
void init (int size)
 
- Protected Attributes inherited from GenericVector< DawgPosition >
int32_t size_used_
 
int32_t size_reserved_
 
DawgPosition * data_
 
TessCallback1< DawgPosition > * clear_cb_
 
TessResultCallback2< bool, DawgPosition const &, DawgPosition const &> * compare_cb_
 
- Static Protected Attributes inherited from GenericVector< DawgPosition >
static const int kDefaultVectorSize
 

Member Function Documentation

◆ add_unique()

bool tesseract::DawgPositionVector::add_unique ( const DawgPosition new_pos,
bool  debug,
const char *  debug_msg 
)
inline

Adds an entry for the given dawg_index with the given node to the vec. Returns false if the same entry already exists in the vector, true otherwise.

◆ clear()

void tesseract::DawgPositionVector::clear ( )
inline

Overload clear() in order to avoid allocating/deallocating memory when clearing the vector and re-inserting entries into it later.


The documentation for this class was generated from the following file: