MythTV  master
upnpsubscription.h
Go to the documentation of this file.
1 #ifndef UPNPSUBSCRIPTION_H
2 #define UPNPSUBSCRIPTION_H
3 
4 #include "mythevent.h"
5 #include "upnp.h"
6 
7 class Subscription;
8 
10 {
11  public:
12  UPNPSubscription(const QString &share_path, int port);
13  virtual ~UPNPSubscription();
14 
15  QStringList GetBasePaths() override // HttpServerExtension
16  { return QStringList( "/Subscriptions" ); }
17  bool ProcessRequest(HTTPRequest *pRequest) override; // HttpServerExtension
18 
19  int Subscribe(const QString &usn, const QUrl &url, const QString &path);
20  void Unsubscribe(const QString &usn);
21  int Renew(const QString &usn);
22  void Remove(const QString &usn);
23 
24  private:
25  Q_DISABLE_COPY(UPNPSubscription)
26  static bool SendUnsubscribeRequest(const QString &usn, const QUrl &url,
27  const QString &path, const QString &uuid);
28  static int SendSubscribeRequest(const QString &callback,
29  const QString &usn, const QUrl &url,
30  const QString &path, const QString &uuidin,
31  QString &uuidout);
32  private:
33  QHash<QString, Subscription*> m_subscriptions;
34  QMutex m_subscriptionLock {QMutex::Recursive};
35  QString m_callback {"NOTSET"};
36 };
37 
38 #endif // UPNPSUBSCRIPTION_H
Superclass for making an object have a set of listeners.
virtual bool ProcessRequest(HTTPRequest *pRequest)=0
static void(* m_callback)(void *, QString &)
#define UPNP_PUBLIC
Definition: upnpexp.h:9
QStringList GetBasePaths() override
QHash< QString, Subscription * > m_subscriptions