--- /dev/null
+#include "fetch_list_of_active_groups.h"
+
+FetchListOfActiveGroups::FetchListOfActiveGroups(std::vector<Group> *active) : active(active) {}
+void FetchListOfActiveGroups::operator() (pqxx::transaction<> &t)
+{
+ // make sure we start with an empty list
+ active->erase(active->begin(), active->end());
+
+ pqxx::result res( t.exec("SELECT * FROM bigscreen.active_groups") );
+ for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
+ Group g;
+
+ g.tournament = i["tournament"].as(g.tournament);
+ g.round = i["round"].as(g.round);
+ g.parallel = i["parallel"].as(g.parallel);
+
+ active->push_back(g);
+ }
+}