Class ShellPointerArray¶
Defined in File ShellPointerArray.hpp
Class Documentation¶
-
class ShellPointerArray¶
[source] Flat array of Shell pointers that supports in-place shuffle/reverse.
Built from the linked list of tests held by Registry so that O(n) random access is available for shuffling. Call relink_tests_in_order() after sorting to restore the linked-list structure. Used by Registry::shuffle_tests() and Registry::reverse_tests().
Public Functions
-
ShellPointerArray(Shell *first_test)¶
Build the array by walking the linked list starting at
first_test.- Parameters:
first_test – Head of the Shell linked list.
-
void shuffle(size_t seed)¶
Shuffle the array using a seeded Fisher-Yates algorithm.
- Parameters:
seed – Seed for the rand() function pointer.
-
ShellPointerArray(Shell *first_test)¶