VirtualCircularList Class Reference

#include <VirtualCircularList.h>

Inheritance diagram for VirtualCircularList:
Object

# Public Member Functions

void constructor ()
 Class' constructor.
void * front ()
void * back ()
VirtualNode begin ()
VirtualNode end ()
VirtualNode find (const void *const data)
int32 getDataIndex (const void *const data)
VirtualNode getNode (int32 index)
int32 getNodeIndex (VirtualNode node)
void * getDataAtIndex (int32 index)
int32 getCount ()
VirtualNode pushFront (const void *const data)
VirtualNode pushBack (const void *const data)
VirtualNode insertAfter (VirtualNode node, const void *const data)
VirtualNode insertBefore (VirtualNode node, const void *const data)
void * popFront ()
void * popBack ()
bool removeNode (VirtualNode node)
bool removeData (const void *const data)
void reverse ()
 Reverse the nodes of the list.
void copy (VirtualCircularList sourceList)
void clear ()
 Remove all the nodes from the list without deleting the data.
void deleteData ()
 Delete all the data and nodes from the list.

# Protected Attributes

VirtualNode head
 List's first node.
VirtualNode tail
 List's last element.

# Additional Inherited Members

- Private Member Functions inherited from Object
void constructor ()
 Class' constructor.
const void * getVTable ()
bool mutateTo (const void *targetClass)
- Static Private Member Functions inherited from Object
static Object getCast (void *object, ClassPointer targetClassGetClassMethod, ClassPointer baseClassGetClassMethod)
- Private Attributes inherited from Object
void * vTable
 Pointer to the class's virtual table.

# Detailed Description

Class VirtualCircularList

Inherits from Object

Implements a circular linked list of non fixed data type elements.

Definition at line 34 of file VirtualCircularList.h.

# Member Function Documentation

# back()

void * VirtualCircularList::back ( )

Retrieve the last data element of the list.

Returns
Last data element

Definition at line 69 of file VirtualCircularList.c.

# begin()

VirtualNode VirtualCircularList::begin ( )

Retrieve the first node of the list.

Returns
First node

Definition at line 76 of file VirtualCircularList.c.

# clear()

void VirtualCircularList::clear ( )

Remove all the nodes from the list without deleting the data.

Definition at line 524 of file VirtualCircularList.c.

# constructor()

void VirtualCircularList::constructor ( )

Class' constructor.

Definition at line 37 of file VirtualCircularList.c.

# copy()

void VirtualCircularList::copy ( VirtualCircularList sourceList)

Copy the elements from the provided list.

Parameters
sourceListList with the elements to copy

Definition at line 498 of file VirtualCircularList.c.

# deleteData()

void VirtualCircularList::deleteData ( )

Delete all the data and nodes from the list.

Definition at line 549 of file VirtualCircularList.c.

# end()

VirtualNode VirtualCircularList::end ( )

Retrieve the last node of the list.

Returns
Last node

Definition at line 83 of file VirtualCircularList.c.

# find()

VirtualNode VirtualCircularList::find ( const void *const data)

Retrieve the node that holds the provided data.

Parameters
dataPointer to the data to look for
Returns
Node that holds the provided data

Definition at line 90 of file VirtualCircularList.c.

# front()

void * VirtualCircularList::front ( )

Retrieve the first data element of the list.

Returns
First data element

Definition at line 62 of file VirtualCircularList.c.

# getCount()

int32 VirtualCircularList::getCount ( )

Retrieve the number of nodes in the list.

Returns
Number of nodes in the list

Definition at line 212 of file VirtualCircularList.c.

# getDataAtIndex()

void * VirtualCircularList::getDataAtIndex ( int32 index)

Retrieve the data at the provided index in the list.

Parameters
indexIndex within the list
Returns
Data at index in the linked list

# getDataIndex()

int32 VirtualCircularList::getDataIndex ( const void *const data)

Retrieve the index of the node holding the provided data pointer.

Parameters
dataPointer to the data to look for
Returns
The index of the data in the linked list

Definition at line 161 of file VirtualCircularList.c.

# getNode()

VirtualNode VirtualCircularList::getNode ( int32 index)

Retrieve the node at provided position within the list.

Parameters
indexIndex within the list
Returns
Node at the provided index

Definition at line 113 of file VirtualCircularList.c.

# getNodeIndex()

int32 VirtualCircularList::getNodeIndex ( VirtualNode node)

Retrieve the index of the provided node.

Parameters
nodeNode to look for
Returns
The index of the node in the linked list

Definition at line 186 of file VirtualCircularList.c.

# insertAfter()

VirtualNode VirtualCircularList::insertAfter ( VirtualNode node,
const void *const data )

Add a new node to the list with the provided data after the provided node.

Parameters
nodeReference node
dataPointer to the data to insert into the list
Returns
Node holding the data

Definition at line 306 of file VirtualCircularList.c.

# insertBefore()

VirtualNode VirtualCircularList::insertBefore ( VirtualNode node,
const void *const data )

Add a new node to the list with the provided data before the provided node.

Parameters
nodeReference node
dataPointer to the data to insert into the list
Returns
Node holding the data

# popBack()

void * VirtualCircularList::popBack ( )

Remove the last node of the list.

Returns
Pointer to the data hold by the removed node

Definition at line 381 of file VirtualCircularList.c.

# popFront()

void * VirtualCircularList::popFront ( )

Remove the first node of the list.

Returns
Pointer to the data hold by the removed node

Definition at line 348 of file VirtualCircularList.c.

# pushBack()

VirtualNode VirtualCircularList::pushBack ( const void *const data)

Add a new node to the end of the list with the provided data.

Parameters
dataPointer to the data to insert into the list
Returns
Node holding the data

Definition at line 273 of file VirtualCircularList.c.

# pushFront()

VirtualNode VirtualCircularList::pushFront ( const void *const data)

Add a new node to the start of the list with the provided data.

Parameters
dataPointer to the data to insert into the list
Returns
Node holding the data

Definition at line 240 of file VirtualCircularList.c.

# removeData()

bool VirtualCircularList::removeData ( const void *const data)

Remove the provided data from the list.

Parameters
dataPointer to the data to remove from the list
Returns
True if the data was successfully removed

Definition at line 461 of file VirtualCircularList.c.

# removeNode()

bool VirtualCircularList::removeNode ( VirtualNode node)

Remove the provided node from the list.

Parameters
nodeNode to remove
Returns
True if the node was successfully removed

Definition at line 414 of file VirtualCircularList.c.

# reverse()

void VirtualCircularList::reverse ( )

Reverse the nodes of the list.

Definition at line 468 of file VirtualCircularList.c.

# Member Data Documentation

# head

VirtualNode VirtualCircularList::head
protected

List's first node.

Definition at line 39 of file VirtualCircularList.h.

# tail

VirtualNode VirtualCircularList::tail
protected

List's last element.

Definition at line 42 of file VirtualCircularList.h.


The documentation for this class was generated from the following files: