Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SOFT253_Template_Weather_OS_54 by
Diff: LinkedList.cpp
- Branch:
- feature/listSizeLimit
- Revision:
- 54:53ee2d07d684
- Parent:
- 53:abb161ed4c8c
- Child:
- 57:dfcdda1e42b6
diff -r abb161ed4c8c -r 53ee2d07d684 LinkedList.cpp
--- a/LinkedList.cpp Thu Apr 06 19:42:34 2017 +0000
+++ b/LinkedList.cpp Thu Apr 06 19:42:56 2017 +0000
@@ -1,7 +1,10 @@
#include "LinkedList.h"
#include <stdio.h>
#include <ctype.h>
-// constructor
+/*
+ Constructor
+ Initialises a linked list using the limit given
+*/
LinkedList::LinkedList(int limit)
{
sizeLimit = limit;
@@ -18,6 +21,10 @@
currentSize++;
}
+/*
+ Adds a value to the end of the list - if the list is full, removes the
+ oldest element first to create space
+*/
void LinkedList::addValueEnd(Measure _measure)
{
if(head == NULL)
