Changes

Jump to: navigation, search

Project A3 20141 - OOP344

26 bytes removed, 09:12, 3 April 2014
Part 2: Templated Linked List: Updated ListNode<T>
==== Public Functions ====
; ListNode(const T& v = T(), ListNode<T>* n = NULL): Constructor. Note the default values. Initializes the internally held value These functions are similar to v and the next pointer to n.; ListNode(const ListNode<T>& src): Copy constructor. Should initialize the internally held value to src's internally held value. Should initialize '''next''' to '''NULL'''.; ListNode& operator=(const ListNode<T>& src): Assignment operator. Should set the internally held value to src's internally held value. Should set '''next''' to '''NULL'''. Should do '''NOTHING''' in the case of '''self-assignment''' (ie ListNode<T> x; x = x;). Returns a reference to the current object.; ~ListNode(): Destructor. As this node does not allocate any memory, this function can remain emptytheir IntListNode counterparts.
; Constructor: Accepts two arguments.;* '''Important'''. Const T val() constreference to initialize node's value. Defaults to a default constructed T.;* Pointer to next node in the list. Defaults to NULL.; Copy Constructor: Val getter. Returns Initializes internal value as a copy of the source's internal value internally held. Sets this object's next pointer to NULL.; void val(const T&)Standard Assignment Operator: Val setterAssigns source's internal value to the current object's internal value. Sets this object's next pointer to NULL. Does not alter the internally held value object in the case of self-assignment. Returns a reference to the incoming valuecurrent object.
; ListNode<val: Val getter. Const function. Does not accept parameters. Returns internal value.; val: Val setter. '''Important'''. Receives a const T>* reference. Sets internal value to received reference. Does not return anything. ; next() const: Next getter. Const function. Does not accept parameters. Returns the internally held pointer to next pointernode.
=== Class: List<T>, Files [list.h], Test: 1 ===

Navigation menu