X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bigscreen%2Ffetch_highscore.h;fp=bigscreen%2Ffetch_highscore.h;h=a8cf7068e251a2f6b85ec4d671afaad1d6cdceec;hb=2983d99d9fc6a9da891873b08a8f9360d88d104a;hp=0000000000000000000000000000000000000000;hpb=f0955c93464993b82d087f48150d363c6c57054f;p=ccbs diff --git a/bigscreen/fetch_highscore.h b/bigscreen/fetch_highscore.h new file mode 100644 index 0000000..a8cf706 --- /dev/null +++ b/bigscreen/fetch_highscore.h @@ -0,0 +1,24 @@ +#ifndef _FETCH_HIGHSCORE_H +#define _FETCH_HIGHSCORE_H 1 + +#include +#include "widestring.h" + +struct Highscore { + unsigned song; + int score; + widestring nick, tournament_name; +}; + +/* A transactor that fetches the all-time high score for a song */ +class FetchHighscore : public pqxx::transactor<> { +private: + unsigned song; + Highscore *hs; + +public: + FetchHighscore(unsigned song, Highscore *hs); + void operator() (pqxx::transaction<> &t); +}; + +#endif /* !defined(_FETCH_MAX_SCORE_FOR_SONG_H) */