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