Updated packaging for new 0.0.2 release.
[qwerkisync] / EventProcessors / Writer.h
1 /*
2  * Copyright (C) 2011, Jamie Thompson
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public
6  * License as published by the Free Software Foundation; either
7  * version 3 of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public
15  * License along with this program; If not, see
16  * <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef EVENTPROCESSORS_WRITER_H
20 #define EVENTPROCESSORS_WRITER_H
21
22 #include "iEventProcessor.h"
23
24 #include "EventWriters/iEventWriter.h"
25 class NumberToNameLookup;
26 class Settings;
27
28 #include <QObject>
29 template <typename T1> class QList;
30 #include <QSharedPointer>
31
32 namespace EventProcessors
33 {
34         class Writer : public QObject, public iEventProcessor
35         {
36                 Q_OBJECT
37
38         public:
39                 Writer(Settings &settings, const NumberToNameLookup &numberToNamelookup);
40                 ~Writer();
41
42                 const Settings & CurrentSettings() { return m_Settings; }
43
44                 virtual void Process(EventTypes::iEvent &event);
45                 virtual void EmitEventProcessed(int eventsProcessed, int totalEvents);
46
47         private:
48                 const Settings & m_Settings;
49                 QList<QSharedPointer<EventWriters::iEventWriter> > m_Writers;
50
51         signals:
52                 void EventProcessed(int current, int total);
53         };
54 }
55
56 #endif // EVENTPROCESSORS_WRITER_H