libktorrent  2.2.0
logsystemmanager.h
1 /***************************************************************************
2  * Copyright (C) 2008 by Joris Guisson and Ivan Vasic *
3  * joris.guisson@gmail.com *
4  * ivasic@gmail.com *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20  ***************************************************************************/
21 #ifndef BTLOGSYSTEMMANAGER_H
22 #define BTLOGSYSTEMMANAGER_H
23 
24 #include <QObject>
25 #include <QMap>
26 #include <QScopedPointer>
27 #include <util/constants.h>
28 #include <ktorrent_export.h>
29 
30 namespace bt
31 {
32 
36  class KTORRENT_EXPORT LogSystemManager : public QObject
37  {
38  Q_OBJECT
39 
40 
41  LogSystemManager();
42  public:
43  ~LogSystemManager() override;
44 
46  void registerSystem(const QString & name,Uint32 id);
47 
49  void unregisterSystem(const QString & name);
50 
51  typedef QMap<QString,Uint32>::iterator iterator;
52 
53  iterator begin() {return systems.begin();}
54  iterator end() {return systems.end();}
55 
56  static LogSystemManager & instance();
57 
59  Uint32 systemID(const QString & name);
60 
61  Q_SIGNALS:
62  void registered(const QString & name);
63  void unregisted(const QString & name);
64 
65  private:
66  QMap<QString,Uint32> systems;
67  static QScopedPointer<LogSystemManager> self;
68  };
69 
70 }
71 
72 #endif
bt::LogSystemManager
Definition: logsystemmanager.h:56