How uncodem/sorters works
Sorters is a C++/SFML sorting visualizer. A command-line user supplies the algorithm, element count, update speed, and sort direction; the application creates the array and window, runs the selected sort on a worker thread, and displays sorting operations as animated bars. The array reports mutations and comparisons through an observer interface; the window queues these events and applies them while rendering. The README is brief, so algorithm and display capabilities are grounded in the sampled source; no other product branches are documented.
Main entry points: main.cpp CLI and runner · window.cpp SFML visualizer · array.cpp Sortable array · sorters.cpp Sorting algorithms
Components 10
Application
- CLI and runner
src/main.cpp - Sort interrupt
src/closer.hpp
Sorting
- Sortable array
src/array.cpp - Sorting algorithms
src/sorters.cpp - Sorter interface
src/sorter.hpp
Visualization
- Observer interface
src/observer.hpp - SFML visualizer
src/window.cpp - Console observer
src/default_observer.cpp
Other components
- CLI user
- SFML graphics
Connections 14
- CLI user → CLI and runner: provides arguments
src/main.cpp - CLI and runner → Sorting algorithms: selects algorithm
src/main.cpp - CLI and runner → Sortable array: creates data
src/main.cpp - CLI and runner → SFML visualizer: creates window
src/main.cpp - CLI and runner → Sortable array: registers observer
src/main.cpp - CLI and runner → Sorting algorithms: starts sorting
src/main.cpp - Sorting algorithms → Sortable array: compares and mutates
src/sorters.cpp - Sortable array → Observer interface: dispatches events
src/array.cpp - SFML visualizer → Observer interface: implements callbacks
- Console observer → Observer interface: implements callbacks
- SFML visualizer → Sortable array: copies initial data
src/window.cpp - SFML visualizer → SFML graphics: renders bars
src/window.cpp - SFML visualizer → Sort interrupt: throws on exit
src/window.cpp - CLI and runner → Sort interrupt: catches interruption
src/main.cpp