tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
GenericVector< T > Class Template Reference

#include <baseapi.h>

Inheritance diagram for GenericVector< T >:
Collaboration diagram for GenericVector< T >:

Public Member Functions

 GenericVector ()
 
 GenericVector (int size, const T &init_val)
 
 GenericVector (const GenericVector &other)
 
GenericVector< T > & operator+= (const GenericVector &other)
 
GenericVector< T > & operator= (const GenericVector &other)
 
 ~GenericVector ()
 
void reserve (int size)
 
void double_the_size ()
 
void init_to_size (int size, const T &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
 
T & get (int index) const
 
T & back () const
 
T & operator[] (int index) const
 
pop_back ()
 
int get_index (const T &object) const
 
bool contains (const T &object) const
 
contains_index (int index) const
 
int push_back (T object)
 
void operator+= (const T &t)
 
int push_back_new (const T &object)
 
int push_front (const T &object)
 
void set (const T &t, int index)
 
void insert (const T &t, int index)
 
void remove (int index)
 
void truncate (int size)
 
void set_clear_callback (TessCallback1< T > *cb)
 
void set_compare_callback (TessResultCallback2< bool, T const &, T const &> *cb)
 
void clear ()
 
void delete_data_pointers ()
 
void move (GenericVector< T > *from)
 
bool write (FILE *f, TessResultCallback2< bool, FILE *, T const &> *cb) const
 
bool read (tesseract::TFile *f, TessResultCallback2< bool, tesseract::TFile *, T *> *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 T &target) const
 
int binary_search (const T &target) const
 
void compact_sorted ()
 
void compact (TessResultCallback1< bool, int > *delete_cb)
 
dot_product (const GenericVector< T > &other) const
 
int choose_nth_item (int target_index)
 
void swap (int index1, int index2)
 
bool WithinBounds (const T &rangemin, const T &rangemax) const
 

Static Public Member Functions

static bool SkipDeSerialize (tesseract::TFile *fp)
 
static bool SkipDeSerializeClasses (tesseract::TFile *fp)
 
static T * double_the_size_memcpy (int current_size, T *data)
 

Protected Member Functions

int choose_nth_item (int target_index, int start, int end, unsigned int *seed)
 
void init (int size)
 

Protected Attributes

int32_t size_used_
 
int32_t size_reserved_
 
T * data_
 
TessCallback1< T > * clear_cb_
 
TessResultCallback2< bool, T const &, T const & > * compare_cb_
 

Static Protected Attributes

static const int kDefaultVectorSize = 4
 

Constructor & Destructor Documentation

◆ GenericVector() [1/3]

template<typename T>
GenericVector< T >::GenericVector ( )
inline

◆ GenericVector() [2/3]

template<typename T>
GenericVector< T >::GenericVector ( int  size,
const T &  init_val 
)
inline

◆ GenericVector() [3/3]

template<typename T>
GenericVector< T >::GenericVector ( const GenericVector< T > &  other)
inline

◆ ~GenericVector()

template<typename T >
GenericVector< T >::~GenericVector ( )

Member Function Documentation

◆ back()

template<typename T >
T & GenericVector< T >::back ( ) const

◆ binary_search()

template<typename T>
int GenericVector< T >::binary_search ( const T &  target) const
inline

◆ bool_binary_search()

template<typename T>
bool GenericVector< T >::bool_binary_search ( const T &  target) const
inline

◆ choose_nth_item() [1/2]

template<typename T>
int GenericVector< T >::choose_nth_item ( int  target_index)
inline

◆ choose_nth_item() [2/2]

template<typename T >
int GenericVector< T >::choose_nth_item ( int  target_index,
int  start,
int  end,
unsigned int *  seed 
)
protected

◆ clear()

template<typename T >
void GenericVector< T >::clear ( )

◆ compact()

template<typename T>
void GenericVector< T >::compact ( TessResultCallback1< bool, int > *  delete_cb)
inline

◆ compact_sorted()

template<typename T>
void GenericVector< T >::compact_sorted ( )
inline

◆ contains()

template<typename T>
bool GenericVector< T >::contains ( const T &  object) const

◆ contains_index()

template<typename T >
T GenericVector< T >::contains_index ( int  index) const

◆ delete_data_pointers()

template<typename T >
void GenericVector< T >::delete_data_pointers ( )

◆ DeSerialize() [1/2]

template<typename T >
bool GenericVector< T >::DeSerialize ( bool  swap,
FILE *  fp 
)

◆ DeSerialize() [2/2]

template<typename T >
bool GenericVector< T >::DeSerialize ( tesseract::TFile fp)

◆ DeSerializeClasses() [1/2]

template<typename T >
bool GenericVector< T >::DeSerializeClasses ( bool  swap,
FILE *  fp 
)

◆ DeSerializeClasses() [2/2]

template<typename T >
bool GenericVector< T >::DeSerializeClasses ( tesseract::TFile fp)

◆ dot_product()

template<typename T>
T GenericVector< T >::dot_product ( const GenericVector< T > &  other) const
inline

◆ double_the_size()

template<typename T >
void GenericVector< T >::double_the_size ( )

◆ double_the_size_memcpy()

template<typename T>
static T* GenericVector< T >::double_the_size_memcpy ( int  current_size,
T *  data 
)
inlinestatic

◆ empty()

template<typename T>
bool GenericVector< T >::empty ( ) const
inline

◆ get()

template<typename T >
T & GenericVector< T >::get ( int  index) const

◆ get_index()

template<typename T>
int GenericVector< T >::get_index ( const T &  object) const

◆ init()

template<typename T >
void GenericVector< T >::init ( int  size)
protected

◆ init_to_size()

template<typename T>
void GenericVector< T >::init_to_size ( int  size,
const T &  t 
)

◆ insert()

template<typename T>
void GenericVector< T >::insert ( const T &  t,
int  index 
)

◆ length()

template<typename T>
int GenericVector< T >::length ( ) const
inline

◆ move()

template<typename T>
void GenericVector< T >::move ( GenericVector< T > *  from)

◆ operator+=() [1/2]

template<typename T >
GenericVector< T > & GenericVector< T >::operator+= ( const GenericVector< T > &  other)

◆ operator+=() [2/2]

template<typename T>
void GenericVector< T >::operator+= ( const T &  t)

◆ operator=()

template<typename T >
GenericVector< T > & GenericVector< T >::operator= ( const GenericVector< T > &  other)

◆ operator[]()

template<typename T >
T & GenericVector< T >::operator[] ( int  index) const

◆ pop_back()

template<typename T >
T GenericVector< T >::pop_back ( )

◆ push_back()

template<typename T>
int GenericVector< T >::push_back ( object)

◆ push_back_new()

template<typename T>
int GenericVector< T >::push_back_new ( const T &  object)

◆ push_front()

template<typename T>
int GenericVector< T >::push_front ( const T &  object)

◆ read()

template<typename T>
bool GenericVector< T >::read ( tesseract::TFile f,
TessResultCallback2< bool, tesseract::TFile *, T *> *  cb 
)

◆ remove()

template<typename T >
void GenericVector< T >::remove ( int  index)

◆ reserve()

template<typename T >
void GenericVector< T >::reserve ( int  size)

◆ resize_no_init()

template<typename T>
void GenericVector< T >::resize_no_init ( int  size)
inline

◆ reverse()

template<typename T>
void GenericVector< T >::reverse ( )
inline

◆ Serialize() [1/2]

template<typename T >
bool GenericVector< T >::Serialize ( FILE *  fp) const

◆ Serialize() [2/2]

template<typename T >
bool GenericVector< T >::Serialize ( tesseract::TFile fp) const

◆ SerializeClasses() [1/2]

template<typename T >
bool GenericVector< T >::SerializeClasses ( FILE *  fp) const

◆ SerializeClasses() [2/2]

template<typename T >
bool GenericVector< T >::SerializeClasses ( tesseract::TFile fp) const

◆ set()

template<typename T>
void GenericVector< T >::set ( const T &  t,
int  index 
)

◆ set_clear_callback()

template<typename T>
void GenericVector< T >::set_clear_callback ( TessCallback1< T > *  cb)

◆ set_compare_callback()

template<typename T>
void GenericVector< T >::set_compare_callback ( TessResultCallback2< bool, T const &, T const &> *  cb)

◆ size()

template<typename T>
int GenericVector< T >::size ( ) const
inline

◆ size_reserved()

template<typename T>
int GenericVector< T >::size_reserved ( ) const
inline

◆ SkipDeSerialize()

template<typename T >
bool GenericVector< T >::SkipDeSerialize ( tesseract::TFile fp)
static

◆ SkipDeSerializeClasses()

template<typename T >
bool GenericVector< T >::SkipDeSerializeClasses ( tesseract::TFile fp)
static

◆ sort() [1/2]

template<typename T >
void GenericVector< T >::sort ( )

◆ sort() [2/2]

template<typename T>
void GenericVector< T >::sort ( int(*)(const void *, const void *)  comparator)
inline

◆ swap()

template<typename T>
void GenericVector< T >::swap ( int  index1,
int  index2 
)
inline

◆ truncate()

template<typename T>
void GenericVector< T >::truncate ( int  size)
inline

◆ unsigned_size()

template<typename T>
size_t GenericVector< T >::unsigned_size ( ) const
inline

◆ WithinBounds()

template<typename T>
bool GenericVector< T >::WithinBounds ( const T &  rangemin,
const T &  rangemax 
) const
inline

◆ write()

template<typename T>
bool GenericVector< T >::write ( FILE *  f,
TessResultCallback2< bool, FILE *, T const &> *  cb 
) const

Member Data Documentation

◆ clear_cb_

template<typename T>
TessCallback1<T>* GenericVector< T >::clear_cb_
protected

◆ compare_cb_

template<typename T>
TessResultCallback2<bool, T const &, T const &>* GenericVector< T >::compare_cb_
mutableprotected

◆ data_

template<typename T>
T* GenericVector< T >::data_
protected

◆ kDefaultVectorSize

template<typename T>
const int GenericVector< T >::kDefaultVectorSize = 4
staticprotected

◆ size_reserved_

template<typename T>
int32_t GenericVector< T >::size_reserved_
protected

◆ size_used_

template<typename T>
int32_t GenericVector< T >::size_used_
protected

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