Linklist module Module that handles linklists
This module provides an easy and powerful interface for manipulating linked lists.
Using this data structure as an example:
typedef struct __orxFOO_t { orxU32 u32Data; Data } orxFOO;
Creating a bank to allocate memory storage:
orxBANK *pstBank = orxBank_Create(10, sizeof(orxFOO), orxBANK_KU32_FLAG_NONE, orxMEMORY_TYPE_MAIN);
You can then instantiate it this way:
orxFOO *pstNode = (orxFOO *)orxBank_Allocate(pstBank); pstNode->u32Data = 205;
Having this basic behavior, you can add list linking to it.
To do so, you need to include in your structure an orxLINKLIST_NODE member as *FIRST MEMBER*:
typedef struct __orxFOO_t { orxLINKLIST_NODE stNode; orxU32 u32Data; } orxFOO;
Your data structure can now be linked in lists:
orxLINKLIST stList; orxLinkList_AddEnd(&stList, (orxLINKLIST_NODE *)pstNode);
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddAfter | ( | orxLINKLIST_NODE * | _pstRefNode, |
| orxLINKLIST_NODE * | _pstNode | ||
| ) |
Adds a node after another one
| [in] | _pstRefNode | Reference node (add after this one) |
| [in] | _pstNode | Node to add |
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddBefore | ( | orxLINKLIST_NODE * | _pstRefNode, |
| orxLINKLIST_NODE * | _pstNode | ||
| ) |
Adds a node before another one
| [in] | _pstRefNode | Reference node (add before this one) |
| [in] | _pstNode | Node to add |
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddEnd | ( | orxLINKLIST * | _pstList, |
| orxLINKLIST_NODE * | _pstNode | ||
| ) |
Adds a node at the end of a list
| [in] | _pstList | Concerned list |
| [in] | _pstNode | Node to add |
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_AddStart | ( | orxLINKLIST * | _pstList, |
| orxLINKLIST_NODE * | _pstNode | ||
| ) |
Adds a node at the start of a list
| [in] | _pstList | Concerned list |
| [in] | _pstNode | Node to add |
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_Clean | ( | orxLINKLIST * | _pstList ) |
Cleans a linklist
| [in] | _pstList | Concerned list |
| static orxINLINE orxU32 orxLinkList_GetCounter | ( | const orxLINKLIST * | _pstList ) | [static] |
Gets a list counter
| [in] | _pstList | Concerned list |
Definition at line 228 of file orxLinkList.h.
| static orxINLINE orxLINKLIST_NODE* orxLinkList_GetFirst | ( | const orxLINKLIST * | _pstList ) | [static] |
Gets a list first node
| [in] | _pstList | Concerned list |
Definition at line 202 of file orxLinkList.h.
| static orxINLINE orxLINKLIST_NODE* orxLinkList_GetLast | ( | const orxLINKLIST * | _pstList ) | [static] |
Gets a list last node
| [in] | _pstList | Concerned list |
Definition at line 215 of file orxLinkList.h.
| static orxINLINE orxLINKLIST* orxLinkList_GetList | ( | const orxLINKLIST_NODE * | _pstNode ) | [static] |
Gets a node list
| [in] | _pstNode | Concerned node |
Definition at line 162 of file orxLinkList.h.
| static orxINLINE orxLINKLIST_NODE* orxLinkList_GetNext | ( | const orxLINKLIST_NODE * | _pstNode ) | [static] |
Gets next node in list
| [in] | _pstNode | Concerned node |
Definition at line 188 of file orxLinkList.h.
| static orxINLINE orxLINKLIST_NODE* orxLinkList_GetPrevious | ( | const orxLINKLIST_NODE * | _pstNode ) | [static] |
Gets previous node in list
| [in] | _pstNode | Concerned node |
Definition at line 175 of file orxLinkList.h.
| orxDLLAPI orxSTATUS orxFASTCALL orxLinkList_Remove | ( | orxLINKLIST_NODE * | _pstNode ) |
Removes a node from its list
| [in] | _pstNode | Concerned node |
1.5.6