]> git.sesse.net Git - ccbs/blob - bigscreen/fetch_highscore.h
Actually fetch and display the top 10 scores.
[ccbs] / bigscreen / fetch_highscore.h
1 #ifndef _FETCH_HIGHSCORE_H
2 #define _FETCH_HIGHSCORE_H 1
3
4 #include <pqxx/transactor>
5 #include "widestring.h"
6
7 struct Highscore {
8         unsigned song;
9         int score;
10         widestring nick, tournament_name;
11 };
12
13 /* A transactor that fetches the all-time high score for a song */
14 class FetchHighscore : public pqxx::transactor<> {
15 private:
16         unsigned song;
17         Highscore *hs;
18
19 public:
20         FetchHighscore(unsigned song, Highscore *hs);
21         void operator() (pqxx::transaction<> &t);
22 };
23
24 #endif /* !defined(_FETCH_MAX_SCORE_FOR_SONG_H) */