18 #ifndef _SERVICE_H_X_INCLUDED_ 19 #define _SERVICE_H_X_INCLUDED_ 21 #include <sys/types.h> 27 #include "libupnpp/upnppexports.hxx" 28 #include "libupnpp/log.hxx" 29 #include "libupnpp/soaphelp.hxx" 30 #include "libupnpp/upnperrcodes.hxx" 31 #include "libupnpp/control/cdircontent.hxx" 36 class UPnPServiceDesc;
59 virtual void changed(
const char *nm,
int val) = 0;
61 virtual void changed(
const char *nm,
const char *val) = 0;
66 virtual void changed(
const char * , std::vector<int> ) {}
79 std::function<void (const std::unordered_map<std::string, std::string>&)>
107 virtual bool reSubscribe();
111 const std::string& getFriendlyName()
const;
112 const std::string& getDeviceId()
const;
113 const std::string& getServiceType()
const;
114 const std::string& getActionURL()
const;
115 const std::string& getModelName()
const;
116 const std::string& getManufacturer()
const;
129 int runTrivialAction(
const std::string& actionName);
133 template <
class T>
int runSimpleGet(
const std::string& actnm,
134 const std::string& valnm,
138 template <
class T>
int runSimpleAction(
const std::string& actnm,
139 const std::string& valnm,
165 virtual bool serviceTypeMatch(
const std::string& tp) = 0;
195 void unregisterCallback();
203 class UPNPP_LOCAL Internal;
204 Internal *m{
nullptr};
std::function< void(const std::unordered_map< std::string, std::string > &)> evtCBFunc
Type of the event callbacks.
Definition: service.hxx:80
Store the values to be encoded in a SOAP response.
Definition: soaphelp.hxx:90
Decode incoming Soap call data.
Definition: soaphelp.hxx:35
virtual void changed(const char *, UPnPDirObject)
Report change to track metadata (parsed as as Content Directory entry).
Definition: service.hxx:64
Definition: service.hxx:82
virtual void registerCallback()
To be overridden in classes which actually support events.
Definition: service.hxx:192
Data holder for a UPnP service, parsed from the device XML description.
Definition: description.hxx:46
virtual bool serviceInit(const UPnPDeviceDesc &, const UPnPServiceDesc &)
Service-specific part of initialization.
Definition: service.hxx:174
UPnP Media Server directory entry, converted from XML data.
Definition: cdircontent.hxx:62
virtual void autorenew_failed()
Subscription autorenew failed.
Definition: service.hxx:69
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:27
To be implemented by upper-level client code for event reporting.
Definition: service.hxx:55
virtual void changed(const char *, std::vector< int >)
Special for ohplaylist.
Definition: service.hxx:66