#include <clst.h>
Definition at line 70 of file clst.h.
◆ CLIST()
◆ ~CLIST()
◆ add_sorted()
bool CLIST::add_sorted |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
void * |
new_data |
|
) |
| |
Definition at line 170 of file clst.cpp.
173 if (last ==
nullptr || comparator(&last->data, &new_data) < 0) {
175 new_element->data = new_data;
176 if (last ==
nullptr) {
177 new_element->next = new_element;
179 new_element->next = last->next;
180 last->next = new_element;
184 }
else if (!unique || last->data != new_data) {
187 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
188 void* data = it.data();
189 if (data == new_data && unique)
191 if (comparator(&data, &new_data) > 0)
194 if (it.cycled_list())
195 it.add_to_end(new_data);
197 it.add_before_then_move(new_data);
◆ assign_to_sublist()
Definition at line 97 of file clst.cpp.
101 "Destination list must be empty before extracting a sublist";
104 LIST_NOT_EMPTY.
error (
"CLIST.assign_to_sublist",
ABORT,
nullptr);
106 last = start_it->extract_sublist (end_it);
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
◆ empty()
bool CLIST::empty |
( |
| ) |
const |
|
inline |
◆ internal_deep_clear()
void CLIST::internal_deep_clear |
( |
void(*)(void *) |
zapper | ) |
|
◆ length()
int32_t CLIST::length |
( |
| ) |
const |
Definition at line 115 of file clst.cpp.
119 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward())
◆ set_subtract()
void CLIST::set_subtract |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
CLIST * |
minuend, |
|
|
CLIST * |
subtrahend |
|
) |
| |
Definition at line 208 of file clst.cpp.
216 for (m_it.mark_cycle_pt(); !m_it.cycled_list(); m_it.forward()) {
217 void* minu = m_it.data();
218 void* subtra =
nullptr;
220 subtra = s_it.data();
221 while (!s_it.at_last() &&
222 comparator(&subtra, &minu) < 0) {
224 subtra = s_it.data();
227 if (subtra ==
nullptr || comparator(&subtra, &minu) != 0)
bool add_sorted(int comparator(const void *, const void *), bool unique, void *new_data)
◆ shallow_clear()
void CLIST::shallow_clear |
( |
| ) |
|
◆ shallow_copy()
void CLIST::shallow_copy |
( |
CLIST * |
from_list | ) |
|
|
inline |
Definition at line 103 of file clst.h.
105 last = from_list->last;
◆ singleton()
bool CLIST::singleton |
( |
| ) |
const |
|
inline |
Definition at line 99 of file clst.h.
100 return last !=
nullptr ? (last == last->next) :
false;
◆ sort()
void CLIST::sort |
( |
int |
comparator const void *, const void * | ) |
|
Definition at line 131 of file clst.cpp.
142 base = (
void **) malloc (
count *
sizeof (
void *));
146 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
147 *current = it.extract ();
152 qsort(base,
count,
sizeof(*base), comparator);
156 for (i = 0; i <
count; i++) {
157 it.add_to_end (*current);
◆ CLIST_ITERATOR
The documentation for this class was generated from the following files:
- /usr/src/tesseract-ocr.master/src/ccutil/clst.h
- /usr/src/tesseract-ocr.master/src/ccutil/clst.cpp