]> git.sesse.net Git - ccbs/blobdiff - bigscreen/fetch_max_score_for_players.h
Read max score for all players in one shot as well, with a new query and an index...
[ccbs] / bigscreen / fetch_max_score_for_players.h
diff --git a/bigscreen/fetch_max_score_for_players.h b/bigscreen/fetch_max_score_for_players.h
new file mode 100644 (file)
index 0000000..e722d3c
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _FETCH_MAX_SCORE_FOR_PLAYERS_H
+#define _FETCH_MAX_SCORE_FOR_PLAYERS_H 1
+
+#include <pqxx/transactor>
+#include <map>
+
+/* A transactor that fetches the maximum score for each player on chosen songs */
+class FetchMaxScoreForPlayers : public pqxx::transactor<> {
+private:
+       unsigned tournament, round;
+       std::map<unsigned, unsigned> *scores;
+
+public:
+       FetchMaxScoreForPlayers(unsigned tournament, unsigned round, std::map<unsigned, unsigned> *scores);
+       void operator() (pqxx::transaction<> &t);
+};
+
+#endif /* !defined(_FETCH_MAX_SCORE_FOR_PLAYERS_H) */