Tesseract 3.01
GenericVector< T > Class Template Reference

#include <genericvector.h>

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

List of all members.

Public Member Functions

 GenericVector ()
 GenericVector (int size)
 GenericVector (const GenericVector &other)
GenericVector< T > & operator+= (const GenericVector &other)
GenericVector< T > & operator= (const GenericVector &other)
virtual ~GenericVector ()
void reserve (int size)
void double_the_size ()
void init_to_size (int size, T t)
int size () const
int length () const
bool empty () const
T & get (int index) const
T & operator[] (int index) const
int get_index (T object) const
bool contains (T object) const
contains_index (int index) const
int push_back (T object)
void operator+= (T t)
int push_front (T object)
void set (T t, int index)
void insert (T t, int index)
virtual void remove (int index)
virtual void truncate (int size)
void set_clear_callback (TessCallback1< T > *cb)
void set_compare_callback (TessResultCallback2< bool, T const &, T const & > *cb)
virtual void clear ()
void delete_data_pointers ()
void move (GenericVector< T > *from)
bool write (FILE *f, TessResultCallback2< bool, FILE *, T const & > *cb) const
bool read (FILE *f, TessResultCallback3< bool, FILE *, T *, bool > *cb, bool swap)
virtual bool Serialize (FILE *fp) const
virtual bool DeSerialize (bool swap, FILE *fp)
bool SerializeClasses (FILE *fp) const
bool DeSerializeClasses (bool swap, FILE *fp)
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

Static Public Member Functions

static T * double_the_size_memcpy (int current_size, T *data)

Protected Member Functions

void init (int size)

Protected Attributes

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

Static Protected Attributes

static const int kDefaultVectorSize = 4

template<typename T>
class GenericVector< T >


Constructor & Destructor Documentation

template<typename T>
GenericVector< T >::GenericVector ( ) [inline]
template<typename T>
GenericVector< T >::GenericVector ( int  size) [inline, explicit]
template<typename T>
GenericVector< T >::GenericVector ( const GenericVector< T > &  other) [inline]
template<typename T >
GenericVector< T >::~GenericVector ( ) [virtual]

Member Function Documentation

template<typename T>
int GenericVector< T >::binary_search ( const T &  target) const [inline]
template<typename T>
bool GenericVector< T >::bool_binary_search ( const T &  target) const [inline]
template<typename T >
void GenericVector< T >::clear ( ) [virtual]
template<typename T>
void GenericVector< T >::compact ( TessResultCallback1< bool, int > *  delete_cb) [inline]
template<typename T>
void GenericVector< T >::compact_sorted ( ) [inline]
template<typename T>
bool GenericVector< T >::contains ( object) const
template<typename T >
T GenericVector< T >::contains_index ( int  index) const
template<typename T >
void GenericVector< T >::delete_data_pointers ( )
template<typename T >
bool GenericVector< T >::DeSerialize ( bool  swap,
FILE *  fp 
) [virtual]

Reimplemented in tesseract::PointerVector< T >.

template<typename T >
bool GenericVector< T >::DeSerializeClasses ( bool  swap,
FILE *  fp 
)
template<typename T>
T GenericVector< T >::dot_product ( const GenericVector< T > &  other) const [inline]
template<typename T >
void GenericVector< T >::double_the_size ( )
template<typename T>
static T* GenericVector< T >::double_the_size_memcpy ( int  current_size,
T *  data 
) [inline, static]
template<typename T>
bool GenericVector< T >::empty ( ) const [inline]
template<typename T >
T & GenericVector< T >::get ( int  index) const
template<typename T>
int GenericVector< T >::get_index ( object) const
template<typename T >
void GenericVector< T >::init ( int  size) [protected]
template<typename T>
void GenericVector< T >::init_to_size ( int  size,
t 
)
template<typename T>
void GenericVector< T >::insert ( t,
int  index 
)
template<typename T>
int GenericVector< T >::length ( ) const [inline]
template<typename T>
void GenericVector< T >::move ( GenericVector< T > *  from)
template<typename T >
GenericVector< T > & GenericVector< T >::operator+= ( const GenericVector< T > &  other)
template<typename T>
void GenericVector< T >::operator+= ( t)
template<typename T >
GenericVector< T > & GenericVector< T >::operator= ( const GenericVector< T > &  other)
template<typename T >
T & GenericVector< T >::operator[] ( int  index) const
template<typename T>
int GenericVector< T >::push_back ( object)
template<typename T>
int GenericVector< T >::push_front ( object)
template<typename T>
bool GenericVector< T >::read ( FILE *  f,
TessResultCallback3< bool, FILE *, T *, bool > *  cb,
bool  swap 
)
template<typename T >
void GenericVector< T >::remove ( int  index) [virtual]

Reimplemented in tesseract::PointerVector< T >.

template<typename T >
void GenericVector< T >::reserve ( int  size)
template<typename T >
bool GenericVector< T >::Serialize ( FILE *  fp) const [virtual]

Reimplemented in tesseract::PointerVector< T >.

template<typename T >
bool GenericVector< T >::SerializeClasses ( FILE *  fp) const
template<typename T>
void GenericVector< T >::set ( t,
int  index 
)
template<typename T>
void GenericVector< T >::set_clear_callback ( TessCallback1< T > *  cb)
template<typename T>
void GenericVector< T >::set_compare_callback ( TessResultCallback2< bool, T const &, T const & > *  cb)
template<typename T>
int GenericVector< T >::size ( ) const [inline]
template<typename T >
void GenericVector< T >::sort ( )

Reimplemented in tesseract::PointerVector< T >.

template<typename T>
void GenericVector< T >::sort ( int(*)(const void *, const void *)  comparator) [inline]
template<typename T>
virtual void GenericVector< T >::truncate ( int  size) [inline, virtual]

Reimplemented in tesseract::PointerVector< T >.

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

Member Data Documentation

template<typename T>
TessCallback1<T>* GenericVector< T >::clear_cb_ [protected]
template<typename T>
TessResultCallback2<bool, T const &, T const &>* GenericVector< T >::compare_cb_ [mutable, protected]
template<typename T>
T* GenericVector< T >::data_ [protected]
template<typename T>
const int GenericVector< T >::kDefaultVectorSize = 4 [static, protected]
template<typename T>
inT32 GenericVector< T >::size_reserved_ [protected]
template<typename T>
inT32 GenericVector< T >::size_used_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines