Gymbo

Public Member Functions | Public Attributes | List of all members
gymbo::Linkedlist< T > Class Template Reference

Doubly Linked List Implementation. More...

`#include <utils.h>`

## Public Member Functions
| Linkedlist ()
| Default constructor for Linkedlist. More...
uint32_t | len ()
| Get the length of the linked list. More...
void | push (T data)
| Pushes a new element onto the back of the linked list. More...
T * | back ()
| Returns the element at the back of the linked list. More...
void | pop ()
| Pops the element at the back of the linked list. More...

## Public Attributes
LLNode< T > * | ghost
| Ghost node for maintaining previous tails during pops. More...
LLNode< T > * | head
| Pointer to the head of the linked list. More...
LLNode< T > * | tail
| Pointer to the tail of the linked list. More...

## Detailed Description

### template<typename T>
class gymbo::Linkedlist< T >

Doubly Linked List Implementation.

The `Linkedlist` class provides a simple implementation of a doubly linked list. It supports basic operations such as pushing elements onto the back, getting the length, accessing the element at the back, and popping the element at the back.

Template Parameters

  T | The type of data to store in the linked list.

## Constructor & Destructor Documentation

## ◆ Linkedlist()

template<typename T >

gymbo::Linkedlist< T >::Linkedlist | ( |  | ) |
| inline

Default constructor for Linkedlist.

## Member Function Documentation

## ◆ back()

template<typename T >

T* gymbo::Linkedlist< T >::back | ( |  | ) |
| inline

Returns the element at the back of the linked list.

Returns
  The element at the back of the linked list.

## ◆ len()

template<typename T >

uint32_t gymbo::Linkedlist< T >::len | ( |  | ) |
| inline

Get the length of the linked list.

Returns
  The length of the linked list.

## ◆ pop()

template<typename T >

void gymbo::Linkedlist< T >::pop | ( |  | ) |
| inline

Pops the element at the back of the linked list.

## ◆ push()

template<typename T >

void gymbo::Linkedlist< T >::push | ( | T | data | ) |
| inline

Pushes a new element onto the back of the linked list.

Parameters

  data | The element to push onto the linked list.

## Member Data Documentation

## ◆ ghost

template<typename T >

LLNode<T>* gymbo::Linkedlist< T >::ghost

Ghost node for maintaining previous tails during pops.

## ◆ head

template<typename T >

LLNode<T>* gymbo::Linkedlist< T >::head

Pointer to the head of the linked list.

## ◆ tail

template<typename T >

LLNode<T>* gymbo::Linkedlist< T >::tail

Pointer to the tail of the linked list.

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

- libgymbo/utils.h