|
a/libupnpp/control/service.hxx |
|
b/libupnpp/control/service.hxx |
|
... |
|
... |
21 |
#include <functional>
|
21 |
#include <functional>
|
22 |
#include <unordered_map>
|
22 |
#include <unordered_map>
|
23 |
|
23 |
|
24 |
#include <upnp/upnp.h>
|
24 |
#include <upnp/upnp.h>
|
25 |
|
25 |
|
26 |
#include "libupnpp/log.hxx"
|
|
|
27 |
#include "libupnpp/soaphelp.hxx"
|
26 |
#include "libupnpp/soaphelp.hxx"
|
28 |
#include "libupnpp/upnpp_p.hxx"
|
|
|
29 |
#include "libupnpp/control/description.hxx"
|
27 |
#include "libupnpp/control/description.hxx"
|
30 |
#include "libupnpp/control/cdircontent.hxx"
|
28 |
#include "libupnpp/control/cdircontent.hxx"
|
31 |
|
|
|
32 |
|
29 |
|
33 |
namespace UPnPClient {
|
30 |
namespace UPnPClient {
|
34 |
|
31 |
|
35 |
/** To be implemented by upper-level client code for event
|
32 |
/** To be implemented by upper-level client code for event
|
36 |
* reporting. Runs in an event thread. This could for example be
|
33 |
* reporting. Runs in an event thread. This could for example be
|
|
... |
|
... |
54 |
class Service {
|
51 |
class Service {
|
55 |
public:
|
52 |
public:
|
56 |
/** Construct by copying data from device and service objects.
|
53 |
/** Construct by copying data from device and service objects.
|
57 |
*/
|
54 |
*/
|
58 |
Service(const UPnPDeviceDesc& device,
|
55 |
Service(const UPnPDeviceDesc& device,
|
59 |
const UPnPServiceDesc& service)
|
56 |
const UPnPServiceDesc& service);
|
60 |
: m_reporter(0),
|
|
|
61 |
m_actionURL(caturl(device.URLBase, service.controlURL)),
|
|
|
62 |
m_eventURL(caturl(device.URLBase, service.eventSubURL)),
|
|
|
63 |
m_serviceType(service.serviceType),
|
|
|
64 |
m_deviceId(device.UDN),
|
|
|
65 |
m_friendlyName(device.friendlyName),
|
|
|
66 |
m_manufacturer(device.manufacturer),
|
|
|
67 |
m_modelName(device.modelName)
|
|
|
68 |
{
|
|
|
69 |
initEvents();
|
|
|
70 |
subscribe();
|
|
|
71 |
}
|
|
|
72 |
|
57 |
|
73 |
/** An empty one */
|
58 |
/** An empty one */
|
74 |
Service() : m_reporter(0) {}
|
59 |
Service() : m_reporter(0) {}
|
75 |
|
60 |
|
76 |
virtual ~Service()
|
61 |
virtual ~Service()
|
|
... |
|
... |
92 |
}
|
77 |
}
|
93 |
|
78 |
|
94 |
virtual void installReporter(VarEventReporter* reporter)
|
79 |
virtual void installReporter(VarEventReporter* reporter)
|
95 |
{
|
80 |
{
|
96 |
m_reporter = reporter;
|
81 |
m_reporter = reporter;
|
97 |
LOGDEB("Reporter now " << m_reporter << endl);
|
|
|
98 |
}
|
82 |
}
|
99 |
|
83 |
|
100 |
// Can't copy these because this does not make sense for the
|
84 |
// Can't copy these because this does not make sense for the
|
101 |
// member function callback.
|
85 |
// member function callback.
|
102 |
Service(Service const&) = delete;
|
86 |
Service(Service const&) = delete;
|