Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
Burger::DoubleLinkedList Class Reference

Simple double linked list manager. More...

Inheritance diagram for Burger::DoubleLinkedList:
Inheritance graph
[legend]
Collaboration diagram for Burger::DoubleLinkedList:
Collaboration graph
[legend]

Public Member Functions

 DoubleLinkedList () noexcept
 Initializer for a DoubleLinkedList.
 
 ~DoubleLinkedList ()
 Destructor for a DoubleLinkedList.
 
void detach (void) noexcept
 Detach this object from any attached linked list.
 
void insert_after (DoubleLinkedList *pInput) noexcept
 Attach the input object after this one in the list.
 
void insert_before (DoubleLinkedList *pInput) noexcept
 Attach the input object before this one in the list.
 
DoubleLinkedListget_next (void) const noexcept
 Get the next pointer in the list.
 
DoubleLinkedListget_previous (void) const noexcept
 Get the previous pointer in the list.
 

Static Public Member Functions

static DoubleLinkedListNew (void) noexcept
 Create a new DoubleLinkedList instance.
 

Private Member Functions

 DoubleLinkedList (const DoubleLinkedList &)=delete
 
DoubleLinkedListoperator= (const DoubleLinkedList &)=delete
 
 DoubleLinkedList (DoubleLinkedList &&)=delete
 
DoubleLinkedListoperator= (DoubleLinkedList &&)=delete
 

Additional Inherited Members

- Protected Member Functions inherited from Burger::DoubleLinkedList_t
void init (void) noexcept
 Double linked list initialization.
 
void detach (void) noexcept
 Detach entry from connected list.
 
void insert_after (DoubleLinkedList_t *pInput) noexcept
 Insert the supplied object after this object.
 
void insert_before (DoubleLinkedList_t *pInput) noexcept
 Insert the supplied object before this object.
 
- Protected Attributes inherited from Burger::DoubleLinkedList_t
DoubleLinkedList_tm_pNext
 Pointer to the next entry.
 
DoubleLinkedList_tm_pPrev
 Pointer to the previous entry.
 

Detailed Description

Simple double linked list manager.


Using inlined code, this class handles all the tasks needed to manage a circular doubly linked list. All objects when created point to themselves and can be added and removed to other linked list objects at will.

Constructor & Destructor Documentation

◆ DoubleLinkedList() [1/3]

Burger::DoubleLinkedList::DoubleLinkedList ( const DoubleLinkedList & )
privatedelete

◆ DoubleLinkedList() [2/3]

Burger::DoubleLinkedList::DoubleLinkedList ( DoubleLinkedList && )
privatedelete

◆ DoubleLinkedList() [3/3]

Burger::DoubleLinkedList::DoubleLinkedList ( )
inlinenoexcept

Initializer for a DoubleLinkedList.


Set the links to point to itself. The object is not attached to another list

See also
~DoubleLinkedList() or detach()

◆ ~DoubleLinkedList()

Burger::DoubleLinkedList::~DoubleLinkedList ( )
inline

Destructor for a DoubleLinkedList.


By calling detach(), this object will remove itself from any other list and then be ready for memory disposal

See also
detach()

Member Function Documentation

◆ detach()

void Burger::DoubleLinkedList::detach ( void )
inlinenoexcept

Detach this object from any attached linked list.


This object will remove itself from any other list and both pointers will point to itself

See also
DoubleLinkedList_t::detach(void), insert_before(DoubleLinkedList *), insert_after(DoubleLinkedList *), Delete(const T*), or ~DoubleLinkedList()

◆ get_next()

const DoubleLinkedList * Burger::DoubleLinkedList::get_next ( void ) const
inlinenoexcept

Get the next pointer in the list.


Return the pointer to the next object in the list. Since the list is circular, it's the caller's responsibility to ensure that the start and end are detected properly

Returns
Pointer to the next DoubleLinkedList object in the chain
See also
get_previous(void) const

◆ get_previous()

const DoubleLinkedList * Burger::DoubleLinkedList::get_previous ( void ) const
inlinenoexcept

Get the previous pointer in the list.


Return the pointer to the previous object in the list. Since the list is circular, it's the caller's responsibility to ensure that the start and end are detected properly

Returns
Pointer to the previous DoubleLinkedList object in the chain
See also
get_next(void) const

◆ insert_after()

void Burger::DoubleLinkedList::insert_after ( DoubleLinkedList * pInput)
inlinenoexcept

Attach the input object after this one in the list.


Detach the input object from any linked list and then attach the input object after this one in the current list.

Parameters
pInputPointer to a DoubleLinkedList object to link after this one
See also
DoubleLinkedList_t::insert_after(DoubleLinkedList_t*), insert_before(DoubleLinkedList *) or detach(void)

◆ insert_before()

void Burger::DoubleLinkedList::insert_before ( DoubleLinkedList * pInput)
inlinenoexcept

Attach the input object before this one in the list.


Detach the input object from any linked list and then attach the input object before this one in the current list.

Parameters
pInputPointer to a DoubleLinkedList object to link before this one
See also
DoubleLinkedList_t::insert_before(DoubleLinkedList_t*), insert_after(DoubleLinkedList *) or detach(void)

◆ New()

Burger::DoubleLinkedList *BURGER_API Burger::DoubleLinkedList::New ( void )
staticnoexcept

Create a new DoubleLinkedList instance.


Allocate memory using Burger::Alloc() and initialize a DoubleLinkedList with it.

Returns
nullptr if out of memory
See also
Delete(const T*)

◆ operator=() [1/2]

DoubleLinkedList & Burger::DoubleLinkedList::operator= ( const DoubleLinkedList & )
privatedelete

◆ operator=() [2/2]

DoubleLinkedList & Burger::DoubleLinkedList::operator= ( DoubleLinkedList && )
privatedelete