#include <clst.h>
Definition at line 70 of file clst.h.
| bool CLIST::add_sorted |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
void * |
new_data |
|
) |
| |
Definition at line 199 of file clst.cpp.
202 if (
last ==
NULL || comparator(&
last->data, &new_data) < 0) {
204 new_element->data = new_data;
206 new_element->next = new_element;
213 }
else if (!unique ||
last->data != new_data) {
216 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
217 void* data = it.data();
218 if (data == new_data && unique)
220 if (comparator(&data, &new_data) > 0)
223 if (it.cycled_list())
224 it.add_to_end(new_data);
226 it.add_before_then_move(new_data);
Definition at line 109 of file clst.cpp.
113 "Destination list must be empty before extracting a sublist";
123 last = start_it->extract_sublist (end_it);
const ERRCODE NULL_OBJECT
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
| bool CLIST::empty |
( |
| ) |
const |
|
inline |
| void CLIST::internal_deep_clear |
( |
void(*)(void *) |
zapper | ) |
|
Definition at line 42 of file clst.cpp.
const ERRCODE NULL_OBJECT
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
| inT32 CLIST::length |
( |
| ) |
const |
Definition at line 133 of file clst.cpp.
142 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward())
const ERRCODE NULL_OBJECT
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
| void CLIST::set_subtract |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
CLIST * |
minuend, |
|
|
CLIST * |
subtrahend |
|
) |
| |
Definition at line 237 of file clst.cpp.
245 for (m_it.mark_cycle_pt(); !m_it.cycled_list(); m_it.forward()) {
246 void* minu = m_it.data();
249 subtra = s_it.data();
250 while (!s_it.at_last() &&
251 comparator(&subtra, &minu) < 0) {
253 subtra = s_it.data();
256 if (subtra ==
NULL || comparator(&subtra, &minu) != 0)
bool add_sorted(int comparator(const void *, const void *), bool unique, void *new_data)
| void CLIST::shallow_clear |
( |
| ) |
|
Definition at line 75 of file clst.cpp.
const ERRCODE NULL_OBJECT
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
| void CLIST::shallow_copy |
( |
CLIST * |
from_list | ) |
|
|
inline |
Definition at line 103 of file clst.h.
105 last = from_list->last;
| bool CLIST::singleton |
( |
| ) |
const |
|
inline |
| void CLIST::sort |
( |
int |
comparatorconst void *, const void * | ) |
|
Definition at line 155 of file clst.cpp.
171 base = (
void **) malloc (count *
sizeof (
void *));
175 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
176 *current = it.extract ();
181 qsort ((
char *) base, count,
sizeof (*base), comparator);
185 for (i = 0; i <
count; i++) {
186 it.add_to_end (*current);
const ERRCODE NULL_OBJECT
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccutil/clst.h
- /home/abuild/rpmbuild/BUILD/tesseract-ocr-3.02.02/ccutil/clst.cpp