libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
ohtime.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 _OHTIME_HXX_INCLUDED_
19 #define _OHTIME_HXX_INCLUDED_
20 
21 #include "libupnpp/config.h"
22 
23 #include <unordered_map>
24 #include <memory> // for shared_ptr
25 #include <string> // for string
26 #include <vector> // for vector
27 
28 #include "service.hxx" // for Service
29 
30 
31 namespace UPnPClient {
32 
33 class OHTime;
34 class UPnPDeviceDesc;
35 class UPnPServiceDesc;
36 
37 typedef std::shared_ptr<OHTime> OHTMH;
38 
43 class OHTime : public Service {
44 public:
45 
46  OHTime(const UPnPDeviceDesc& device, const UPnPServiceDesc& service)
47  : Service(device, service) {
48  }
49  OHTime() {}
50  virtual ~OHTime() {}
51 
53  static bool isOHTMService(const std::string& st);
54  virtual bool serviceTypeMatch(const std::string& tp);
55 
56  struct Time {
57  int trackCount;
58  int duration;
59  int seconds;
60  };
61  int time(Time&);
62 
63 protected:
64  /* My service type string */
65  static const std::string SType;
66 
67 private:
68  void evtCallback(const std::unordered_map<std::string, std::string>&);
69  void registerCallback();
70 };
71 
72 } // namespace UPnPClient
73 
74 #endif /* _OHTIME_HXX_INCLUDED_ */
Service()
Empty object.
Definition: service.cxx:127
static bool isOHTMService(const std::string &st)
Test service type from discovery message.
Definition: ohtime.cxx:43
Definition: service.hxx:73
Definition: ohtime.hxx:56
Data holder for a UPnP service, parsed from the device XML description.
Definition: description.hxx:46
OHTime Service client class.
Definition: ohtime.hxx:43
virtual bool serviceTypeMatch(const std::string &tp)
Perform a comparison to the service type string for this specific service.
Definition: ohtime.cxx:48
Data holder for a UPnP device, parsed from the XML description obtained during discovery.
Definition: description.hxx:142
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition: avlastchg.cxx:28