51 DoubleLinkedList

The macros mDoubleLinkedListElementPtrs() and mDefineDoubleLinkedList() allow for an element type to be stored in a double linked list. The pointers to the prev and next elements are stored directly in the Element class. This allows an element to very quickly remove itself from the list.

The following shows an example usage

class MyElement
{
    int x;
    mDoubleLinkedListElementPtrs(MyList,MyElement)
};

mDefineDoubleLinkedList(MyList,MyElement)

DoubleLinkedList.h

Source: Ceda/cxPersistStore/src/DoubleLinkedList.h