Added a "top 5 chosen songs this tournament" screen.
[ccbs] / bigscreen / fetch_top_chosen_songs_for_tournament.h
1 #ifndef _FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H
2 #define _FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H 1
3
4 #include <pqxx/transactor>
5 #include <vector>
6 #include "widestring.h"
7
8 struct TopChosen {
9         widestring title, shorttitle;
10         unsigned frequency;
11
12         bool operator< (const TopChosen &other) const;
13 };
14
15 /* A transactor that fetches the best N scores for a given tournament */
16 class FetchTopChosenSongsForTournament : public pqxx::transactor<> {
17 private:
18         unsigned tournament, num;
19         std::vector<TopChosen> *chosen;
20
21 public:
22         FetchTopChosenSongsForTournament(unsigned tournament, unsigned num, std::vector<TopChosen> *chosen);
23         void operator() (pqxx::transaction<> &t);
24 };
25
26 #endif /* !defined(_FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H) */