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 e3cd02c..7f46559 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 19937b2..9740a8e 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: