18 #ifndef _SERVICE_H_X_INCLUDED_ 19 #define _SERVICE_H_X_INCLUDED_ 21 #include <sys/types.h> 27 #include "libupnpp/control/cdircontent.hxx" 28 #include "libupnpp/log.hxx" 29 #include "libupnpp/soaphelp.hxx" 30 #include "libupnpp/upnperrcodes.hxx" 35 class UPnPServiceDesc;
52 virtual void changed(
const char *nm,
int val) = 0;
54 virtual void changed(
const char *nm,
const char *val) = 0;
59 virtual void changed(
const char * , std::vector<int> ) {}
68 std::function<void (const std::unordered_map<std::string, std::string>&)>
95 virtual void reSubscribe();
99 const std::string& getFriendlyName()
const;
100 const std::string& getDeviceId()
const;
101 const std::string& getServiceType()
const;
102 const std::string& getActionURL()
const;
103 const std::string& getModelName()
const;
104 const std::string& getManufacturer()
const;
117 int runTrivialAction(
const std::string& actionName);
121 template <
class T>
int runSimpleGet(
const std::string& actnm,
122 const std::string& valnm,
126 template <
class T>
int runSimpleAction(
const std::string& actnm,
127 const std::string& valnm,
150 virtual bool serviceTypeMatch(
const std::string& tp) = 0;
180 void unregisterCallback();
std::function< void(const std::unordered_map< std::string, std::string > &)> evtCBFunc
Type of the event callbacks.
Definition: service.hxx:69
Store the values to be encoded in a SOAP response.
Definition: soaphelp.hxx:88
Decode incoming Soap call data.
Definition: soaphelp.hxx:33
virtual void changed(const char *, UPnPDirObject)
Report change to track metadata (parsed as as Content Directory entry).
Definition: service.hxx:57
virtual void changed(const char *nm, int val)=0
Report change to named integer state variable.
Definition: service.hxx:71
virtual void registerCallback()
To be overridden in classes which actually support events.
Definition: service.hxx:177
Data holder for a UPnP service, parsed from the device XML description.
Definition: description.hxx:44
virtual bool serviceInit(const UPnPDeviceDesc &, const UPnPServiceDesc &)
Service-specific part of initialization.
Definition: service.hxx:159
UPnP Media Server directory entry, converted from XML data.
Definition: cdircontent.hxx:62
Data holder for a UPnP device, parsed from the XML description obtained during discovery.
Definition: description.hxx:140
Definition: service.cxx:43
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition: avlastchg.cxx:28
To be implemented by upper-level client code for event reporting.
Definition: service.hxx:48
virtual void changed(const char *, std::vector< int >)
Special for ohplaylist.
Definition: service.hxx:59