You may need to maintain 3 containers, to achieve the specified performance.
1. sorted with speed (to take N-fastest clients), use qSort() to sort
2. sorted with IP/Port, use qSort() to sort then use qBinaryFind() to search
3. the master container with actual objects, the first two contain references to this container
you need to implement the appropriate operators (like ==, >) too use the containers (stl / qt algorithms) to be able to sort, find etc.
Bookmarks