--- /dev/null
+#ifndef _FETCH_TOP_SCORES_FOR_TOURNAMENT_H
+#define _FETCH_TOP_SCORES_FOR_TOURNAMENT_H 1
+
+#include <pqxx/transactor>
+#include <vector>
+#include "widestring.h"
+
+struct TopScore {
+ widestring nick, title, shorttitle;
+ unsigned score;
+
+ bool operator< (const TopScore &other) const;
+};
+
+/* A transactor that fetches the best N scores for a given tournament */
+class FetchTopScoresForTournament : public pqxx::transactor<> {
+private:
+ unsigned tournament, num;
+ std::vector<TopScore> *scores;
+
+public:
+ FetchTopScoresForTournament(unsigned tournament, unsigned num, std::vector<TopScore> *scores);
+ void operator() (pqxx::transaction<> &t);
+};
+
+#endif /* !defined(_FETCH_TOP_SCORES_FOR_TOURNAMENT_H) */