aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/upnp/upnpplib.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-26 15:04:56 +0100
committerMax Kellermann <max@duempel.org>2014-01-26 15:04:56 +0100
commitbcc1f933702770c276e7353d71cb0c5fff75bc4a (patch)
treea7251a557d441353fcc630a8eba67b1e1c695efe /src/lib/upnp/upnpplib.hxx
parentb161d723269d851a2d237880b8f5149b58b736c2 (diff)
downloadmpd-bcc1f933702770c276e7353d71cb0c5fff75bc4a.tar.gz
mpd-bcc1f933702770c276e7353d71cb0c5fff75bc4a.tar.xz
mpd-bcc1f933702770c276e7353d71cb0c5fff75bc4a.zip
upnp: add class UpnpCallback
Each Upnp*Async() call passes a new cookie pointer, and the cookie passed to UpnpRegisterClient() appears to be ignored. Using this interface is a more elegant approach than having one single "handler" function.
Diffstat (limited to 'src/lib/upnp/upnpplib.hxx')
-rw-r--r--src/lib/upnp/upnpplib.hxx11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/lib/upnp/upnpplib.hxx b/src/lib/upnp/upnpplib.hxx
index 6759aa16d..cd1762ec4 100644
--- a/src/lib/upnp/upnpplib.hxx
+++ b/src/lib/upnp/upnpplib.hxx
@@ -24,17 +24,11 @@
#include <upnp/upnp.h>
-#include <functional>
-
/** Our link to libupnp. Initialize and keep the handle around */
class LibUPnP {
- typedef std::function<void(Upnp_EventType type, void *event)> Handler;
-
Error init_error;
UpnpClient_Handle m_clh;
- Handler handler;
-
static int o_callback(Upnp_EventType, void *, void *);
public:
@@ -56,11 +50,6 @@ public:
return init_error;
}
- template<typename T>
- void SetHandler(T &&_handler) {
- handler = std::forward<T>(_handler);
- }
-
UpnpClient_Handle getclh()
{
return m_clh;