Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
Loading...
Searching...
No Matches
Fiea::Engine::List< T > Class Template Reference

#include <List.h>

Classes

class  Iterator

Public Types

using size_type = size_t
using value_type = T
using pointer = value_type*
using reference = value_type&

Public Member Functions

 List ()
 Default constructor for the List class.
 List (const List &listToCopy)
 Copy constructor for the List class.
 ~List ()
 Destructor for the List class.
bool operator== (const List &rhs) const
 Equality operator for comparing two lists.
bool operator!= (const List &rhs) const
 Inequality operator for comparing two lists.
Listoperator= (const List &rhs)
 Overloaded assignment operator to copy the contents of another list.
void push_back (const value_type &value)
 Adds a new element to the end of the list.
void push_front (const value_type &value)
 Adds a new element to the front of the list.
void pop_back ()
 Removes the last element from the list.
void pop_front ()
 Removes the first element from the list.
value_typefront ()
 Returns a reference to the first element of the list.
const value_typefront () const
 Returns a const reference to the first element of the list.
value_typeback ()
 Returns a reference to the last element of the list.
const value_typeback () const
 Returns a const reference to the last element of the list.
size_type size () const
 Gets the number of elements in the list.
bool empty () const
 Checks if the list is empty.
Iterator begin ()
 Gets an iterator to the beginning of the list.
Iterator end ()
 Gets an iterator to the end of the list.

Member Typedef Documentation

◆ pointer

template<typename T>
using Fiea::Engine::List< T >::pointer = value_type*

◆ reference

template<typename T>
using Fiea::Engine::List< T >::reference = value_type&

◆ size_type

template<typename T>
using Fiea::Engine::List< T >::size_type = size_t

◆ value_type

template<typename T>
using Fiea::Engine::List< T >::value_type = T

Constructor & Destructor Documentation

◆ List() [1/2]

template<typename T>
Fiea::Engine::List< T >::List ( )

Default constructor for the List class.

Initializes an empty list with no nodes.

Here is the caller graph for this function:

◆ List() [2/2]

template<typename T>
Fiea::Engine::List< T >::List ( const List< T > & listToCopy)

Copy constructor for the List class.

Creates a deep copy of the provided list.

Parameters
listToCopyThe list to copy from.
Here is the call graph for this function:

◆ ~List()

template<typename T>
Fiea::Engine::List< T >::~List ( )

Destructor for the List class.

Deletes all nodes in the list and frees allocated memory.

Member Function Documentation

◆ back() [1/2]

template<typename T>
List< T >::value_type & Fiea::Engine::List< T >::back ( )

Returns a reference to the last element of the list.

Returns
A reference to the last element.
Exceptions
std::runtime_errorIf the list is empty.
Here is the caller graph for this function:

◆ back() [2/2]

template<typename T>
const List< T >::value_type & Fiea::Engine::List< T >::back ( ) const

Returns a const reference to the last element of the list.

Returns
A const reference to the last element.
Exceptions
std::runtime_errorIf the list is empty.

◆ begin()

template<typename T>
List< T >::Iterator Fiea::Engine::List< T >::begin ( )

Gets an iterator to the beginning of the list.

Returns
An iterator pointing to the first element in the list.
Here is the caller graph for this function:

◆ empty()

template<typename T>
bool Fiea::Engine::List< T >::empty ( ) const

Checks if the list is empty.

Returns
True if the list is empty, false otherwise.
Here is the caller graph for this function:

◆ end()

template<typename T>
List< T >::Iterator Fiea::Engine::List< T >::end ( )

Gets an iterator to the end of the list.

Returns
An iterator pointing to the position after the last element.
Here is the caller graph for this function:

◆ front() [1/2]

template<typename T>
List< T >::value_type & Fiea::Engine::List< T >::front ( )

Returns a reference to the first element of the list.

Returns
A reference to the first element.
Exceptions
std::runtime_errorIf the list is empty.
Here is the caller graph for this function:

◆ front() [2/2]

template<typename T>
const List< T >::value_type & Fiea::Engine::List< T >::front ( ) const

Returns a const reference to the first element of the list.

Returns
A const reference to the first element.
Exceptions
std::runtime_errorIf the list is empty.

◆ operator!=()

template<typename T>
bool Fiea::Engine::List< T >::operator!= ( const List< T > & rhs) const

Inequality operator for comparing two lists.

Checks if two lists are not equal by comparing their sizes and node data.

Parameters
rhsThe list to compare with.
Returns
True if the lists are not equal, otherwise false.
Here is the call graph for this function:

◆ operator=()

template<typename T>
List< T >::List & Fiea::Engine::List< T >::operator= ( const List< T > & rhs)

Overloaded assignment operator to copy the contents of another list.

Parameters
rhsThe list to copy from.
Returns
A reference to the current list.
Here is the call graph for this function:

◆ operator==()

template<typename T>
bool Fiea::Engine::List< T >::operator== ( const List< T > & rhs) const

Equality operator for comparing two lists.

Checks if two lists are equal by comparing their sizes and node data.

Parameters
rhsThe list to compare with.
Returns
True if the lists are equal, otherwise false.
Here is the call graph for this function:

◆ pop_back()

template<typename T>
void Fiea::Engine::List< T >::pop_back ( )

Removes the last element from the list.

Here is the caller graph for this function:

◆ pop_front()

template<typename T>
void Fiea::Engine::List< T >::pop_front ( )

Removes the first element from the list.

Here is the caller graph for this function:

◆ push_back()

template<typename T>
void Fiea::Engine::List< T >::push_back ( const value_type & value)

Adds a new element to the end of the list.

Parameters
valueThe value to add to the list.
Here is the caller graph for this function:

◆ push_front()

template<typename T>
void Fiea::Engine::List< T >::push_front ( const value_type & value)

Adds a new element to the front of the list.

Parameters
valueThe value to add to the list.
Here is the caller graph for this function:

◆ size()

template<typename T>
List< T >::size_type Fiea::Engine::List< T >::size ( ) const

Gets the number of elements in the list.

Returns
The number of elements in the list.
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
  • FIEAGameEngine/include/FIEAGameEngine/List.h
  • FIEAGameEngine/include/FIEAGameEngine/List.inl