1 #include "fetch_list_of_active_groups.h"
3 FetchListOfActiveGroups::FetchListOfActiveGroups(std::vector<SkeletonGroup> *active) : active(active) {}
4 void FetchListOfActiveGroups::operator() (pqxx::transaction<> &t)
6 // make sure we start with an empty list
7 active->erase(active->begin(), active->end());
9 pqxx::result res( t.exec("SELECT * FROM bigscreen.active_groups") );
10 for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
13 g.tournament = i["tournament"].as(g.tournament);
14 g.round = i["round"].as(g.round);
15 g.parallel = i["parallel"].as(g.parallel);
16 g.num_machines = i["num_machines"].as(g.num_machines);
17 g.players_per_machine = i["players_per_machine"].as(g.players_per_machine);