X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Ffetch_top_chosen_songs_for_tournament.h;fp=bigscreen%2Ffetch_top_chosen_songs_for_tournament.h;h=9b177bf25426e38be0ce227261f524338622eab9;hp=0000000000000000000000000000000000000000;hb=723136532e3bb8b318b595b9eeef031275d5c72e;hpb=d80bb106f1f7779664efeac8d8786f929610fad5 diff --git a/bigscreen/fetch_top_chosen_songs_for_tournament.h b/bigscreen/fetch_top_chosen_songs_for_tournament.h new file mode 100644 index 0000000..9b177bf --- /dev/null +++ b/bigscreen/fetch_top_chosen_songs_for_tournament.h @@ -0,0 +1,26 @@ +#ifndef _FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H +#define _FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H 1 + +#include +#include +#include "widestring.h" + +struct TopChosen { + widestring title, shorttitle; + unsigned frequency; + + bool operator< (const TopChosen &other) const; +}; + +/* A transactor that fetches the best N scores for a given tournament */ +class FetchTopChosenSongsForTournament : public pqxx::transactor<> { +private: + unsigned tournament, num; + std::vector *chosen; + +public: + FetchTopChosenSongsForTournament(unsigned tournament, unsigned num, std::vector *chosen); + void operator() (pqxx::transaction<> &t); +}; + +#endif /* !defined(_FETCH_TOP_CHOSEN_SONGS_FOR_TOURNAMENT_H) */