BaseListHead< T, NODE > Class Template Reference

#include <baselist.h>

Inheritance diagram for BaseListHead< T, NODE >:

Detailed Description

template<typename T, typename NODE>
class maxon::BaseListHead< T, NODE >

Template for list head pointing to elements of T.

Template Parameters
TContent of the list node.
NODEList node containing T.

Public Member Functions

 BaseListHead ()
 
 ~BaseListHead ()
 
 BaseListHead (BaseListHead &&src)
 
 MAXON_OPERATOR_MOVE_ASSIGNMENT (BaseListHead)
 
Int GetCount () const
 
Bool IsEmpty () const
 
Bool IsPopulated () const
 
T * GetElement (Int idx) const
 
NODE * GetNode (Int idx) const
 
NODE * GetInsertEraseNode (Int idx) const
 
Int GetIndex (const T *x) const
 
NODE * Begin () const
 
NODE * End () const
 

Additional Inherited Members

Constructor & Destructor Documentation

◆ BaseListHead() [1/2]

◆ ~BaseListHead()

◆ BaseListHead() [2/2]

BaseListHead ( BaseListHead< T, NODE > &&  src)

move constructor

Member Function Documentation

◆ MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( BaseListHead< T, NODE >  )

move assignment operator

◆ GetCount()

Int GetCount ( void  ) const

Gets the number of elements.

Returns
Number of elements.

◆ IsEmpty()

Bool IsEmpty ( ) const

Checks if the list is empty. This is the same as GetCount() == 0

Returns
True if the list does not contain any elements.

◆ IsPopulated()

Bool IsPopulated ( void  ) const

Checks if the list contains anything. This is the same as GetCount() != 0

Returns
True if the list contains any elements.

◆ GetElement()

T* GetElement ( Int  idx) const

Gets the element by index.

Returns
Element or nullptr (not element of this)

◆ GetNode()

NODE* GetNode ( Int  idx) const

◆ GetInsertEraseNode()

NODE* GetInsertEraseNode ( Int  idx) const

◆ GetIndex()

Int GetIndex ( const T *  x) const

Gets the index of the element. The element must be part of the array, otherwise (e.g. if x is a copy of an array element) InvalidArrayIndex will be returned.

Returns
Index of element or InvalidArrayIndex (not element of this)

◆ Begin()

NODE* Begin ( ) const

Gets the pointer to the first node.

Returns
Pointer to the first element (equal to End() if the list is empty)

◆ End()

NODE* End ( ) const

Gets the pointer to the virtual end node (the node after the last node). This is the address of a virtual (non-existing) node that contains this list head.

Returns
Pointer to the end node (the node after the last node)