FreeNOS
|
Simple linked list template class. More...
#include <List.h>
Data Structures | |
class | Node |
Represents an item on the List. More... | |
Public Member Functions | |
List () | |
Class constructor. More... | |
List (const List< T > &lst) | |
Copy constructor. More... | |
virtual | ~List () |
Class destructor. More... | |
void | prepend (T t) |
Insert an item at the start of the list. More... | |
void | append (T t) |
Insert an item at the end of the list. More... | |
virtual int | remove (T t) |
Remove all items which are equal to the given item. More... | |
virtual int | remove (Node *node) |
Removes the given node from the list. More... | |
virtual bool | contains (const T t) const |
Check whether an element is on the List. More... | |
virtual void | clear () |
Clears the entire List. More... | |
Node * | head () |
Get the first Node on the list. More... | |
const Node * | head () const |
Get the first Node on the List (read-only). More... | |
Node * | tail () |
Get the last Node on the list. More... | |
const Node * | tail () const |
Get the last Node on the List (read-only). More... | |
T | first () |
Get the first value in the list. More... | |
const T | first () const |
Get the first value as constant. More... | |
T | last () |
Get the last value on the list. More... | |
const T | last () const |
Get the last value on the list as constant. More... | |
virtual const T * | get (Size position) const |
Get a pointer to the item at the given position. More... | |
virtual const T & | at (Size position) const |
Get a reference to the item at the given position. More... | |
virtual bool | isEmpty () const |
Check if the List is empty. More... | |
Size | size () const |
Get the size of the list. More... | |
Size | count () const |
Get the number of items on the list. More... | |
List & | operator<< (T t) |
Append operator. More... | |
bool | operator== (const List< T > &lst) const |
Comparison operator. More... | |
bool | operator!= (const List< T > &lst) const |
Inequality operator. More... | |
Public Member Functions inherited from Sequence< T > | |
virtual int | insert (const T &item) |
Adds the given item to the Sequence, if possible. More... | |
virtual bool | insert (Size position, const T &item) |
Inserts the given item at the given position. More... | |
virtual void | fill (T value) |
Fill the Sequence with the given value. More... | |
virtual bool | removeAt (Size position) |
Removes the item at the given position. More... | |
virtual int | compareTo (const Sequence< T > &s) const |
Compare this Sequence to another Sequence. More... | |
virtual bool | equals (const Sequence< T > &s) const |
Test if this Sequence is equal to an other Sequence. More... | |
const T & | operator[] (int i) const |
Returns the item at the given position in the Sequence. More... | |
const T & | operator[] (Size i) const |
Returns the item at the given position in the Sequence. More... | |
T & | operator[] (int i) |
Returns the item at the given position in the Sequence. More... | |
T & | operator[] (Size i) |
Returns the item at the given position in the Sequence. More... | |
Public Member Functions inherited from Container | |
Container () | |
Constructor. More... | |
virtual | ~Container () |
Destructor. More... | |
virtual bool | reserve (Size size) |
Ensure that at least the given size is available. More... | |
virtual bool | shrink (Size size) |
Shrink the container size by the given amount of items. More... | |
virtual Size | squeeze () |
Try to minimize the memory required in the Container. More... | |
virtual bool | resize (Size size) |
Change the size of the Container. More... | |
Public Member Functions inherited from Comparable< Sequence< T > > | |
virtual | ~Comparable () |
Class destructor. More... | |
Private Attributes | |
Node * | m_head |
Head of the List. More... | |
Node * | m_tail |
Tail of the list. More... | |
Size | m_count |
Number of items currently in the List. More... | |
Simple linked list template class.
|
inline |
Insert an item at the end of the list.
t | Item to insert. |
Definition at line 139 of file List.h.
Referenced by TestSuite::addTest(), chdir(), SunxiCpuConfig::discover(), ATAController::initialize(), Directory::insert(), List< ATADrive * >::List(), List< ATADrive * >::operator<<(), IntelMP::parseEntry(), FileSystemServer::pathHandler(), IntelACPI::scanAPIC(), LinnCreate::setExclude(), String::split(), and ProcessShares::~ProcessShares().
Get a reference to the item at the given position.
position | Index in the list. |
Implements Sequence< T >.
|
inlinevirtual |
Clears the entire List.
Reimplemented from Sequence< T >.
Definition at line 232 of file List.h.
Referenced by Directory::clear(), IntelMP::discover(), IntelACPI::discover(), and Directory::~Directory().
|
inlinevirtual |
Check whether an element is on the List.
t | The element to find. |
Reimplemented from Sequence< T >.
Definition at line 219 of file List.h.
Referenced by Associative< String, FileCache * >::compareTo(), HashTable< String, FileCache * >::keys(), List< ATADrive * >::operator!=(), List< ATADrive * >::operator==(), and ProcessShares::~ProcessShares().
Get the number of items on the list.
Implements Container.
Definition at line 402 of file List.h.
Referenced by CoreServer::bootAll(), CoreServer::getCoreCount(), List< ATADrive * >::operator!=(), List< ATADrive * >::operator==(), MpiHost::parseHostsFile(), CoreServer::prepareCoreInfo(), StdoutReporter::reportBegin(), TAPReporter::reportBegin(), XMLReporter::reportBegin(), CoreServer::setupChannels(), MpiProxy::startLocalProcess(), CoreServer::test(), and IPV4::toAddress().
|
inline |
Get the first value in the list.
Definition at line 292 of file List.h.
Referenced by ATAController::read().
|
inline |
Get a pointer to the item at the given position.
position | Index in the list |
Implements Sequence< T >.
|
inlinevirtual |
Check if the List is empty.
Reimplemented from Container.
Definition at line 382 of file List.h.
Referenced by ATAController::read().
|
inline |
Get the last value on the list.
Definition at line 316 of file List.h.
Referenced by ArgumentParser::parse().
|
inline |
|
inline |
|
inlinevirtual |
Remove all items which are equal to the given item.
t | Item to remove. |
Reimplemented from Sequence< T >.
Definition at line 166 of file List.h.
Referenced by chdir(), List< ATADrive * >::remove(), and ProcessManager::unregisterInterruptNotify().
Number of items currently in the List.
Definition at line 455 of file List.h.
Referenced by List< ATADrive * >::append(), List< ATADrive * >::clear(), List< ATADrive * >::count(), List< ATADrive * >::get(), List< ATADrive * >::List(), List< ATADrive * >::operator!=(), List< ATADrive * >::operator==(), List< ATADrive * >::prepend(), List< ATADrive * >::remove(), and List< ATADrive * >::size().
Head of the List.
Definition at line 449 of file List.h.
Referenced by List< ATADrive * >::append(), List< ATADrive * >::at(), List< ATADrive * >::clear(), List< ATADrive * >::contains(), List< ATADrive * >::first(), List< ATADrive * >::get(), List< ATADrive * >::head(), List< ATADrive * >::isEmpty(), List< ATADrive * >::List(), List< ATADrive * >::operator!=(), List< ATADrive * >::operator==(), List< ATADrive * >::prepend(), List< ATADrive * >::remove(), and List< ATADrive * >::~List().
Tail of the list.
Definition at line 452 of file List.h.
Referenced by List< ATADrive * >::append(), List< ATADrive * >::clear(), List< ATADrive * >::last(), List< ATADrive * >::List(), List< ATADrive * >::prepend(), List< ATADrive * >::remove(), and List< ATADrive * >::tail().