Voffcon Esp32 device server
|
A general linked list ready to be used or Inherited More...
Public Member Functions | |
LinkedList () | |
The list constructor More... | |
virtual int | size () |
Returns current size of LinkedList More... | |
virtual bool | add (int index, T) |
Adds a T object in the specified index; Unlinkand link the LinkedList correcly; Increment _size More... | |
virtual bool | add (T) |
Adds a T object in the end of the LinkedList; Increment _size; More... | |
virtual bool | unshift (T) |
Adds a T object in the start of the LinkedList; Increment _size; More... | |
virtual bool | set (int index, T) |
Set the object at index, with T; Increment _size; More... | |
virtual T | remove (int index) |
Remove object at index; If index is not reachable, returns false; else, decrement _size More... | |
virtual T | pop () |
Remove last object; More... | |
virtual T | shift () |
Remove first object; More... | |
virtual T | get (int index) |
Get the index'th element on the list; Return Element if accessible, else, return false; More... | |
virtual void | clear () |
Clear the entire array That is remove all objects from the list and delete them from memory More... | |
Protected Member Functions | |
ListNode< T > * | getNode (int index) |
Protected Attributes | |
int | _size |
ListNode< T > * | root |
ListNode< T > * | last |
ListNode< T > * | lastNodeGot |
int | lastIndexGot |
bool | isCached |
A general linked list ready to be used or Inherited
LinkedList< T >::LinkedList | ( | ) |
The list constructor
|
virtual |
Adds a T object in the specified index; Unlinkand link the LinkedList correcly; Increment _size
index | Where to add the object in the zero based index |
T | The object to be added |
|
virtual |
Adds a T object in the end of the LinkedList; Increment _size;
T | The object |
Reimplemented in PinWatchList.
|
virtual |
Clear the entire array That is remove all objects from the list and delete them from memory
|
virtual |
Get the index'th element on the list; Return Element if accessible, else, return false;
///
index | Zero based index if the object in the list |
|
virtual |
Remove last object;
|
virtual |
Remove object at index; If index is not reachable, returns false; else, decrement _size
index |
|
virtual |
Set the object at index, with T; Increment _size;
index | Zero based index of where the object is |
T | The object which values will be overwritten |
|
virtual |
Remove first object;
|
virtual |
Returns current size of LinkedList
|
virtual |
Adds a T object in the start of the LinkedList; Increment _size;
T | The object to be added at beginning of list |