PackedIndexLists.kl¶
Types¶
PackedIndexLists (struct)¶
The PackedIndexLists allows to store multiple double-linked lists of UInt32 values into a single memory buffer.
/note List and element keys are not safe-guarded; a wrong usage will lead to unexpected results.
/example require Containers;
function printList( PackedIndexLists lists, PackedIndexListKey listKey ) { report(“Elements:”); PackedIndexListKey key = listKey; UInt32 index; while( lists.getNextIndexAndIncrement( key, index ) ) report(” ” + index ); }
operator entry(){
PackedIndexLists lists;
PackedIndexListKey list1 = lists.createList(); lists.listAddIndex( list1, 3 );
//Keep a key for element 9, as we will remove it later PackedIndexListElementKey element9 = lists.listAddIndex( list1, 9 );
PackedIndexListKey list2 = lists.createList(); lists.listAddIndex( list2, 1 ); lists.listAddIndex( list2, 2 );
lists.listAddIndex( list1, 8 );
lists.listAddIndex( list2, 5 );
//Remove ‘9’ from list1 lists.removeListElement( element9 );
printList( lists, list1 ); printList( lists, list2 ); } /endexample
Methods¶
| PackedIndexLists ( in PackedIndexLists other ) | |
| PackedIndexLists () | |
| clearAll ! ( in Boolean deallocate ) | |
| clearList ! ( in PackedIndexListKey listKey ) | |
| PackedIndexLists | clone ? () |
| PackedIndexListKey | createList ! () |
| deleteList ! ( in PackedIndexListKey listKey ) | |
| String | getListDesc ? ( in PackedIndexListKey listKey ) |
| Size | getListSize_slow ? ( in PackedIndexListKey listKey ) |
| Boolean | getNextIndexAndIncrement ? ( io PackedIndexListElementKey elementKey, io UInt32 index ) |
| PackedIndexListElementKey | listAddIndex ! ( in PackedIndexListKey listKey, in UInt32 index ) |
| Boolean | listIsEmpty ? ( in PackedIndexListKey listKey ) |
| PackedIndexListElementKey | moveElementToList ! ( in PackedIndexListElementKey elementKey, in PackedIndexListKey targetListKey ) |
| removeListElement ! ( in PackedIndexListElementKey elementKey ) |