From bcc1f933702770c276e7353d71cb0c5fff75bc4a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 26 Jan 2014 15:04:56 +0100 Subject: 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. --- src/lib/upnp/upnpplib.hxx | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/lib/upnp/upnpplib.hxx') 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 -#include - /** Our link to libupnp. Initialize and keep the handle around */ class LibUPnP { - typedef std::function 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 - void SetHandler(T &&_handler) { - handler = std::forward(_handler); - } - UpnpClient_Handle getclh() { return m_clh; -- cgit v1.2.3