I have a problem with a ranking system I am using.

Scenario:

An online game with around 10k players calculates a real time ranking of points when a certain event occurs. Events don't occur that often, around 1 time per minute. This ranking is kept in the cache for quick calculations, sorting and access.

Now players can form groups and play against each other, but the scoring system is the same, only the ranking is based for the players in that group.

At first I created for every group a separate ranking, effectively having the same scores as the complete ranking, but with different positions in the ranking.

This is trivial because there are over 1.000 groups and every time an event occurs all the groups would have to be updated.

So what I did now is when the group ranking is requested take only the players that are in that group from the complete ranking and show them. The positions would have to be re-counted.

That re-counting is where the problem is. Because the sub-list is by-reference from the complete ranking list I cannot change the position of the player in the sub-ranking without updating it in the complete ranking, because it's just a reference.

I came up with two solutions:


Create a copy from the record every time it is requested and do some output caching (not very desirable because the rankings are live)
Create a copy and store this in a cache which is reset when an event occurs.
Create a sub-list with just the positions which is updated when an event occurs.


And the last solution: do the position counting in the output instead in the business side. This would be the best solution, only problem is that on some pages this text appears: "You are on position # in the ranking" where # is your ranking position. This number would be tedious to get then.

Does anybody have any suggestions to this problem?


Question: Converting Qt compliant C++ to ui XML(QtDesigner) format:
Answer: The c++ is a really complex language to parse, so it would be really hard / long / expensive to develop such a tool I guess.

The general rule is to never modify generated code ( in your case the code is generated by Qt designer)

You can 


Subclass the generated class and put your modifications in the sub class
Code all your interfaces by yourself from scratch.
If you think Qt designer lack features you can request them or submit patches to Qt. But I don't think Qt intend to extend that, since QML has become the new way to go with interfaces.


The best option for you is probably the first.