Cellular: Add count/dequeue methods in CellularList

pull/12065/head
Ari Parkkila 2019-12-04 03:13:09 -08:00
parent 7374b22191
commit 972d8a6107
1 changed files with 21 additions and 0 deletions

View File

@ -86,6 +86,27 @@ public:
delete current;
}
int count()
{
T *item = _head;
int n = 0;
while (item) {
item = item->next;
n++;
}
return n;
}
T *dequeue()
{
if (!_head) {
return NULL;
}
T *temp = _head;
_head = _head->next;
return temp;
}
void delete_all()
{
T *temp = _head;