]> git.sesse.net Git - ccbs/commitdiff
Move FlagTrigger into its own source file.
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 14:48:37 +0000 (14:48 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 14:48:37 +0000 (14:48 +0000)
bigscreen/Makefile
bigscreen/ccbs_bigscreen.cpp

index e3cd02c7a53017c018693a709fe4a457f75ff908..7f4655963fd585b2429b003d298cca4a386212c1 100644 (file)
@@ -4,7 +4,7 @@ CPPFLAGS=-I/usr/include/postgresql $(shell freetype-config --cflags) -Itinyptc/
 CXXFLAGS=-g -Wall
 LDFLAGS=-L/usr/X11R6/lib
 LIBS=$(shell freetype-config --libs) $(shell libpq3-config) -lpqxx tinyptc/libtinyptc.a -lX11
-CCBS_BIGSCREEN_OBJS=ccbs_bigscreen.o
+CCBS_BIGSCREEN_OBJS=ccbs_bigscreen.o flagtrigger.o
 
 all: ccbs-bigscreen
 
index 19937b246f9e10d672b42e14d1221aa7d62fad43..9740a8e718ed9b9ce9ac1210a07edef545b0fff0 100644 (file)
@@ -7,6 +7,7 @@
 #include FT_FREETYPE_H
 #include <tinyptc.h>
 #include <endian.h>
+#include "flagtrigger.h"
 
 iconv_t ucs4_iconv;
 
@@ -61,33 +62,6 @@ public:
 Tournament active_tournament;
 std::vector<FT_Face> fonts;
 
-/* A trigger that sets a flag whenever it's trigged. */
-class FlagTrigger : pqxx::trigger {
-private:
-       bool flag;
-       
-public:
-       FlagTrigger(pqxx::connection_base &conn, const PGSTD::string &name)
-               : pqxx::trigger(conn, name), flag(false) {}
-       virtual ~FlagTrigger() throw () {}
-       
-       virtual void operator() (int pid)
-       {
-               flag = true;
-               std::fprintf(stderr, "Received a flag trigger from pid %u\n", pid);
-       }
-
-       bool get_flag() const
-       {
-               return flag;
-       }
-
-       void reset_flag()
-       {
-               flag = false;
-       }
-};
-
 /* A transactor that fetches the current tournament and some information about it. */
 class FetchCurrentTournament : public pqxx::transactor<> {
 private: