#include <elst.h>
Definition at line 111 of file elst.h.
◆ add_sorted()
bool tesseract::ELIST::add_sorted |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
ELIST_LINK * |
new_link |
|
) |
| |
|
inline |
Definition at line 176 of file elst.h.
ELIST_LINK * add_sorted_and_find(int comparator(const void *, const void *), bool unique, ELIST_LINK *new_link)
◆ add_sorted_and_find()
ELIST_LINK * tesseract::ELIST::add_sorted_and_find |
( |
int |
comparatorconst void *, const void *, |
|
|
bool |
unique, |
|
|
ELIST_LINK * |
new_link |
|
) |
| |
Definition at line 125 of file elst.cpp.
128 if (last ==
nullptr || comparator(&last, &new_link) < 0) {
129 if (last ==
nullptr) {
130 new_link->next = new_link;
132 new_link->next = last->next;
133 last->next = new_link;
139 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
140 ELIST_LINK *link = it.data();
141 int compare = comparator(&link, &new_link);
144 }
else if (unique && compare == 0) {
148 if (it.cycled_list()) {
149 it.add_to_end(new_link);
151 it.add_before_then_move(new_link);
friend class ELIST_ITERATOR
◆ assign_to_sublist()
Definition at line 67 of file elst.cpp.
70 constexpr ERRCODE LIST_NOT_EMPTY(
"Destination list must be empty before extracting a sublist");
73 LIST_NOT_EMPTY.error(
"ELIST.assign_to_sublist",
ABORT,
nullptr);
76 last = start_it->extract_sublist(end_it);
◆ empty()
bool tesseract::ELIST::empty |
( |
| ) |
const |
|
inline |
◆ internal_clear()
void tesseract::ELIST::internal_clear |
( |
void(*)(void *) |
zapper | ) |
|
◆ internal_deep_copy()
◆ length()
int32_t tesseract::ELIST::length |
( |
| ) |
const |
|
inline |
Definition at line 146 of file elst.h.
148 if (last !=
nullptr) {
150 for (
auto it = last->next; it != last; it = it->next) {
◆ shallow_copy()
void tesseract::ELIST::shallow_copy |
( |
ELIST * |
from_list | ) |
|
|
inline |
Definition at line 132 of file elst.h.
134 last = from_list->last;
◆ singleton()
bool tesseract::ELIST::singleton |
( |
| ) |
const |
|
inline |
Definition at line 128 of file elst.h.
129 return last ? (last ==
last->
next) :
false;
◆ sort()
void tesseract::ELIST::sort |
( |
int |
comparator const void *, const void * | ) |
|
Definition at line 87 of file elst.cpp.
95 std::vector<ELIST_LINK *> base;
101 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
102 base.push_back(it.extract());
106 qsort(&base[0], count,
sizeof(base[0]), comparator);
109 for (
auto current : base) {
110 it.add_to_end(current);
◆ ELIST_ITERATOR
The documentation for this class was generated from the following files: