libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
typedservice.hxx
1/* Copyright (C) 2006-2016 J.F.Dockes
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA
17 */
18#ifndef _TYPEDSERVICE_H_X_INCLUDED_
19#define _TYPEDSERVICE_H_X_INCLUDED_
20
21#include <string>
22#include <vector>
23#include <map>
24
25#include "libupnpp/control/service.hxx"
26
27namespace UPnPClient {
28
40class UPNPP_API TypedService : public Service {
41public:
42
48 TypedService(const std::string& tp);
49
50 ~TypedService() override;
51
53 bool serviceTypeMatch(const std::string& tp) override;
54
63 virtual int runAction(const std::string& name,
64 std::vector<std::string> args,
65 std::map<std::string, std::string>& retdata);
66
67protected:
71 bool serviceInit(const UPnPDeviceDesc& device,
72 const UPnPServiceDesc& service) override;
73
74private:
75 // Suppress warning about the normal Service class runAction being
76 // hidden. Maybe it could be used, but we don't really need it
77 // (it's called by our own runAction()).
78 using Service::runAction;
79 class UPNPP_LOCAL Internal;
80 Internal* m{0};
81 void UPNPP_LOCAL evtCallback(
82 const std::unordered_map<std::string, std::string>&);
83 void UPNPP_LOCAL registerCallback() override;
84};
85
86
104 const std::string& devname, const std::string& servicetype, bool fuzzy);
105
106} // namespace UPnPClient
107
108#endif // _TYPEDSERVICE_H_X_INCLUDED_
Definition service.hxx:88
Definition typedservice.cxx:42
Access an UPnP service actions through a string based interface.
Definition typedservice.hxx:40
Data holder for a UPnP device, parsed from the XML description obtained during discovery.
Definition description.hxx:139
Data holder for a UPnP service, parsed from the device XML description.
Definition description.hxx:46
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition avlastchg.cxx:28
TypedService * findTypedService(const std::string &devname, const std::string &servicetype, bool fuzzy)
Find specified service inside specified device, and build a TypedService object.
Definition typedservice.cxx:180