libupnpp
0.16.0
A C++ wrapper for the Portable UPnP reference library
|
Upnp service base class. More...
#include <service.hxx>
Classes | |
class | Internal |
Public Member Functions | |
UpnpService (const std::string &stp, const std::string &sid, const std::string &xmlfn, UpnpDevice *dev, bool noevents=false) | |
The main role of the derived constructor is to register the service action callbacks by calling UpnpDevice::addActionMapping(). More... | |
virtual bool | getEventData (bool all, std::vector< std::string > &names, std::vector< std::string > &values) |
Retrieve event data. More... | |
UpnpDevice * | getDevice () |
virtual const std::string & | getServiceType () const |
virtual const std::string & | getServiceId () const |
virtual const std::string & | getXMLFn () const |
bool | noevents () const |
Get value of the noevents property. | |
virtual const std::string | errString (int error) const |
Error number to string translation. More... | |
virtual const std::string | serviceErrString (int) const |
Upnp service base class.
The derived class implements the action methods, registers the mappings with the device object, and implements the event data generation.
UPnPProvider::UpnpService::UpnpService | ( | const std::string & | stp, |
const std::string & | sid, | ||
const std::string & | xmlfn, | ||
UpnpDevice * | dev, | ||
bool | noevents = false |
||
) |
The main role of the derived constructor is to register the service action callbacks by calling UpnpDevice::addActionMapping().
The generic constructor registers the object with the device.
stp | Service type. |
stp | Service id. |
xmlfn | XML service description designator. Used within the Device::addService() method to retrieve the data from the implementation librarian. |
dev | The device this service will be attached to, by calling its addService() method. |
noevents | If set, the service will function normally except that no calls will be made to libupnp to broadcast events. This allows a service object to retain its possible internal functions without being externally visible (in conjunction with a description doc edit). |
|
virtual |
Error number to string translation.
UPnP error code values are duplicated and mean different things for different services, so this handles the common codes and calls serviceErrString which should be overriden by the subclasses.
|
virtual |
Retrieve event data.
To be implemented by the derived class if it does generate event data. Also called by the library Return name/value pairs for changed variables in the data arrays.
all | If true, treat all state variable as changed (return full state). This is set when calling after a control point subscribes, to retrieve all eventable data. |
names | Names of returned state variable |
values | Values of the returned state variables, parallel to names. |