Isle
Loading...
Searching...
No Matches
MxList< T > Class Template Reference

[AI] Forward declaration for MxList. More...

#include <mxlist.h>

Inheritance diagram for MxList< T >:
Collaboration diagram for MxList< T >:

Public Member Functions

 MxList ()
 [AI] Constructor. Initializes the list pointers to null (empty list). [AI] More...
 
 ~MxList () override
 [AI] Destructor. Deletes all entries in the list and manages resource ownership. [AI] More...
 
void Append (T p_obj)
 [AI] More...
 
void Prepend (T p_obj)
 [AI] More...
 
void DeleteAll ()
 [AI] More...
 
void Empty ()
 [AI] More...
 
MxU32 GetNumElements ()
 [AI] More...
 

Protected Member Functions

void DeleteEntry (MxListEntry< T > *)
 [AI] More...
 
MxListEntry< T > * InsertEntry (T, MxListEntry< T > *, MxListEntry< T > *)
 [AI] More...
 
- Protected Member Functions inherited from MxCollection< T >
 MxCollection ()
 [AI] Constructs an empty collection, initializing count and default element destructor. More...
 
virtual MxS8 Compare (T a, T b)
 [AI] Compares two elements of the collection (default implementation returns zero; override in subclasses for meaningful comparison). More...
 
 ~MxCollection () override
 [AI] Virtual destructor for proper polymorphic destruction. More...
 
void SetDestroy (void(*p_customDestructor)(T))
 [AI] Assigns a custom destructor function to be used for elements of this collection. More...
 
- Protected Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Protected Attributes

MxListEntry< T > * m_first
 [AI] Pointer to the first entry in the list. [AI] More...
 
MxListEntry< T > * m_last
 [AI] Pointer to the last entry in the list. [AI] More...
 
- Protected Attributes inherited from MxCollection< T >
MxU32 m_count
 [AI] Number of elements currently stored in the collection. More...
 
void(* m_customDestructor )(T)
 [AI] Function pointer to the custom element destructor used for cleanup of elements. More...
 

Friends

class MxListCursor< T >
 [AI] Allows the cursor to access protected members for traversal. [AI] More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from MxCollection< T >
static void Destroy (T obj)
 [AI] Static no-op destroy function; suitable for types that do not need destruction. More...
 

Detailed Description

template<class T>
class MxList< T >

[AI] Forward declaration for MxList.

[AI]

Doubly-linked list implementation. [AI]

[AI] Provides linked-list functionality with element insertion/removal, traversal support, and ownership semantics (via associated destructors). Supports safe iteration and element access. [AI]

Definition at line 89 of file mxlist.h.

Constructor & Destructor Documentation

◆ MxList()

template<class T >
MxList< T >::MxList ( )
inline

[AI] Constructor. Initializes the list pointers to null (empty list). [AI]

Definition at line 92 of file mxlist.h.

◆ ~MxList()

template<class T >
MxList< T >::~MxList ( )
inlineoverride

[AI] Destructor. Deletes all entries in the list and manages resource ownership. [AI]

Definition at line 95 of file mxlist.h.

Member Function Documentation

◆ Append()

template<class T >
void MxList< T >::Append ( p_obj)
inline

[AI]

Appends an element at the end of the list. [AI]

Parameters
p_objElement to append. [AI]

Definition at line 100 of file mxlist.h.

◆ DeleteAll()

template<class T >
void MxList< T >::DeleteAll ( )

[AI]

Deletes all entries and calls the configured destructor for each element. [AI]

◆ DeleteEntry()

template<class T >
void MxList< T >::DeleteEntry ( MxListEntry< T > *  )
protected

[AI]

Deletes a single entry from the list, adjusting pointers; does not invoke value destructor. [AI]

Parameters
p_matchEntry to delete. [AI]

◆ Empty()

template<class T >
void MxList< T >::Empty ( )

[AI]

Clears all entries, but does NOT call destructors on contained objects. [AI]

◆ GetNumElements()

template<class T >
MxU32 MxList< T >::GetNumElements ( )
inline

[AI]

Returns the number of elements present in the list. [AI]

Returns
Element count. [AI]

Definition at line 118 of file mxlist.h.

◆ InsertEntry()

template<class T >
MxListEntry< T > * MxList< T >::InsertEntry ( ,
MxListEntry< T > *  ,
MxListEntry< T > *   
)
protected

[AI]

Inserts a new entry into the list, adjusting previous/next pointers accordingly. [AI]

Parameters
p_newobjValue to insert. [AI]
p_prevNode to insert after (may be NULL for first). [AI]
p_nextNode to insert before (may be NULL for last). [AI]
Returns
Pointer to the newly inserted entry. [AI]

◆ Prepend()

template<class T >
void MxList< T >::Prepend ( p_obj)
inline

[AI]

Prepends an element to the beginning of the list. [AI]

Parameters
p_objElement to prepend. [AI]

Definition at line 105 of file mxlist.h.

Friends And Related Function Documentation

◆ MxListCursor< T >

template<class T >
friend class MxListCursor< T >
friend

[AI] Allows the cursor to access protected members for traversal. [AI]

Definition at line 118 of file mxlist.h.

Member Data Documentation

◆ m_first

template<class T >
MxListEntry<T>* MxList< T >::m_first
protected

[AI] Pointer to the first entry in the list. [AI]

Definition at line 126 of file mxlist.h.

◆ m_last

template<class T >
MxListEntry<T>* MxList< T >::m_last
protected

[AI] Pointer to the last entry in the list. [AI]

Definition at line 127 of file mxlist.h.


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