]> git.sesse.net Git - ccbs/blobdiff - bigscreen/fetch_highscore.h
Fetch the actual high score from the database when showing high score on the group...
[ccbs] / bigscreen / fetch_highscore.h
diff --git a/bigscreen/fetch_highscore.h b/bigscreen/fetch_highscore.h
new file mode 100644 (file)
index 0000000..a8cf706
--- /dev/null
@@ -0,0 +1,24 @@
+#ifndef _FETCH_HIGHSCORE_H
+#define _FETCH_HIGHSCORE_H 1
+
+#include <pqxx/transactor>
+#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) */