![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
abstract base class for LinkedList
Definition at line 76 of file linkedlist.h.
#include <linkedlist.h>
Inherited by frechet::data::LinkedList< T >, and frechet::data::LinkedList< BoundarySegment >.
Public Member Functions | |
BLinkedList (bool circular=false) | |
default constructor; creates an empty list More... | |
BLinkedList (BLinkedList &&that) | |
move constructor More... | |
~BLinkedList () | |
destructor; releases all element objects More... | |
bool | empty () const |
int | size () const |
bool | circular () const |
void | setCircular (bool) |
update the circularity property of this list More... | |
BLinkedList & | operator= (BLinkedList &&that) |
move assigment operator More... | |
void | insert_first (BLinkedListElement *el) |
insert a new element at the beginning of the list; the list takes ownership of the element. Do not delete it yourself. More... | |
void | insert_last (BLinkedListElement *el) |
insert a new element at the end of the list; the list takes ownership of the element. Do not delete it yourself. More... | |
void | insert_before (BLinkedListElement *el, BLinkedListElement *before) |
insert a new element before a certain element of the list; the list takes ownership of the element. Do not delete it yourself. More... | |
void | insert_after (BLinkedListElement *el, BLinkedListElement *after) |
insert a new element after a certain element of the list; the list takes ownership of the element. Do not delete it yourself. More... | |
BLinkedListElement * | remove (BLinkedListElement *el) |
remove an element from the list and release its memory More... | |
void | clear () |
release all elements More... | |
int | concat (BLinkedList &that) |
append all elements of another list, taking ownership of the new elements More... | |
int | swap (BLinkedList &that) |
exchange all elements with another list, taking ownership of the new elements More... | |
Protected Member Functions | |
BLinkedListElement * | operator[] (int i) const |
positional lookup (note: O(n), use with care) More... | |
Protected Attributes | |
BLinkedListElement * | _first |
the first element in the list (or nullptr) More... | |
BLinkedListElement * | _last |
the last element in the list (or nullptr) More... | |
int | _size |
current number of elements More... | |
bool | _circular |
if true, this is a circular list, i.e. the last element is connected to the first element More... | |
Private Member Functions | |
void | dispose () |
release all elements and update anchors More... | |
void | releaseAll () |
release all elements More... | |
BLinkedList (const BLinkedList &) | |
copy constructor. do not use. More... | |
BLinkedList & | operator= (const BLinkedList &) |
copy assigment operator. do not use. More... | |
BLinkedList::BLinkedList | ( | bool | circular = false | ) |
default constructor; creates an empty list
circular | make this list circular (optional) |
Definition at line 16 of file linkedlist.cpp.
BLinkedList::BLinkedList | ( | BLinkedList && | that | ) |
move constructor
Note that there is no copy constructor because we must prevent shallow copies; double-linked elements must not be part of two separate lists.
that | list to move elements from; will be empty on return |
Definition at line 20 of file linkedlist.cpp.
BLinkedList::~BLinkedList | ( | ) |
destructor; releases all element objects
Definition at line 29 of file linkedlist.cpp.
|
inlineprivate |
copy constructor. do not use.
Definition at line 198 of file linkedlist.h.
bool frechet::data::BLinkedList::circular | ( | ) | const |
void BLinkedList::clear | ( | ) |
release all elements
Definition at line 138 of file linkedlist.cpp.
int BLinkedList::concat | ( | BLinkedList & | that | ) |
append all elements of another list, taking ownership of the new elements
that | list to move elements from; will be empty on return |
Definition at line 145 of file linkedlist.cpp.
|
private |
release all elements and update anchors
Definition at line 174 of file linkedlist.cpp.
bool BLinkedList::empty | ( | ) | const |
Definition at line 31 of file linkedlist.cpp.
void BLinkedList::insert_after | ( | BLinkedListElement * | el, |
BLinkedListElement * | after | ||
) |
insert a new element after a certain element of the list; the list takes ownership of the element. Do not delete it yourself.
el | a new element |
after | place to insert the new element after |
Definition at line 82 of file linkedlist.cpp.
void BLinkedList::insert_before | ( | BLinkedListElement * | el, |
BLinkedListElement * | before | ||
) |
insert a new element before a certain element of the list; the list takes ownership of the element. Do not delete it yourself.
el | a new element |
before | place to insert the new element before |
Definition at line 65 of file linkedlist.cpp.
void BLinkedList::insert_first | ( | BLinkedListElement * | el | ) |
insert a new element at the beginning of the list; the list takes ownership of the element. Do not delete it yourself.
el | a new element |
Definition at line 39 of file linkedlist.cpp.
void BLinkedList::insert_last | ( | BLinkedListElement * | el | ) |
insert a new element at the end of the list; the list takes ownership of the element. Do not delete it yourself.
el | a new element |
Definition at line 52 of file linkedlist.cpp.
BLinkedList & BLinkedList::operator= | ( | BLinkedList && | that | ) |
move assigment operator
Note that there is no copy assigment operator because we must prevent shallow copies; double-linked elements must not be part of two separate lists.
that | list to move elements from; will be empty on return |
Definition at line 197 of file linkedlist.cpp.
|
inlineprivate |
copy assigment operator. do not use.
Definition at line 200 of file linkedlist.h.
|
protected |
positional lookup (note: O(n), use with care)
i | index in list |
Definition at line 183 of file linkedlist.cpp.
|
private |
release all elements
Definition at line 207 of file linkedlist.cpp.
BLinkedListElement * BLinkedList::remove | ( | BLinkedListElement * | el | ) |
remove an element from the list and release its memory
el | an element, which must be part of this list |
Definition at line 115 of file linkedlist.cpp.
void BLinkedList::setCircular | ( | bool | circ | ) |
update the circularity property of this list
Definition at line 99 of file linkedlist.cpp.
int BLinkedList::size | ( | ) | const |
Definition at line 37 of file linkedlist.cpp.
int BLinkedList::swap | ( | BLinkedList & | that | ) |
exchange all elements with another list, taking ownership of the new elements
that | list to move elements from |
Definition at line 165 of file linkedlist.cpp.
|
protected |
if true, this is a circular list, i.e. the last element is connected to the first element
Definition at line 85 of file linkedlist.h.
|
protected |
the first element in the list (or nullptr)
Definition at line 79 of file linkedlist.h.
|
protected |
the last element in the list (or nullptr)
Definition at line 81 of file linkedlist.h.
|
protected |
current number of elements
Definition at line 83 of file linkedlist.h.