From: Steinar H. Gunderson Date: Sat, 19 Feb 2005 14:48:37 +0000 (+0000) Subject: Move FlagTrigger into its own source file. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a5b3a3834ca7ca9317230ec7549d88873fe1ce64;p=ccbs Move FlagTrigger into its own source file. --- diff --git a/bigscreen/Makefile b/bigscreen/Makefile index e3cd02c..7f46559 100644 --- a/bigscreen/Makefile +++ b/bigscreen/Makefile @@ -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 diff --git a/bigscreen/ccbs_bigscreen.cpp b/bigscreen/ccbs_bigscreen.cpp index 19937b2..9740a8e 100644 --- a/bigscreen/ccbs_bigscreen.cpp +++ b/bigscreen/ccbs_bigscreen.cpp @@ -7,6 +7,7 @@ #include FT_FREETYPE_H #include #include +#include "flagtrigger.h" iconv_t ucs4_iconv; @@ -61,33 +62,6 @@ public: Tournament active_tournament; std::vector 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: