libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
Classes | Public Types | Public Member Functions | List of all members
UPnPProvider::UpnpService Class Reference

Upnp service base class. More...

#include <service.hxx>

Classes

class  Internal
 

Public Types

enum  UPnPError {
  UPNP_INVALID_ACTION = 401, UPNP_INVALID_ARGS = 402, UPNP_INVALID_VAR = 404, UPNP_ACTION_CONFLICT = 409,
  UPNP_ACTION_FAILED = 501, UPNP_ARG_VALUE_INVALID = 600, UPNP_ARG_VALUE_OUT_OF_RANGE = 601, UPNP_OPTIONAL_ACTION_NOT_IMPLEMENTED = 602,
  UPNP_OUT_OF_MEMORY = 603, UPNP_HUMAN_INTERVENTION_REQUIRED = 604, UPNP_STRING_ARGUMENT_TOO_LONG = 605, UPNP_ACTION_NOT_AUTHORIZED = 606,
  UPNP_SIGNATURE_FAILING = 607, UPNP_SIGNATURE_MISSING = 608, UPNP_NOT_ENCRYPTED = 609, UPNP_INVALID_SEQUENCE = 610,
  UPNP_INVALID_CONTROL_URLS = 611, UPNP_NO_SUCH_SESSION = 612
}
 

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...
 
UpnpDevicegetDevice ()
 
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
 

Detailed Description

Upnp service base class.

The derived class implements the action methods, registers the mappings with the device object, and implements the event data generation.

Constructor & Destructor Documentation

◆ UpnpService()

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.

Parameters
stpService type.
stpService id.
xmlfnXML service description designator. Used within the Device::addService() method to retrieve the data from the implementation librarian.
devThe device this service will be attached to, by calling its addService() method.
noeventsIf 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).

Member Function Documentation

◆ errString()

const std::string UPnPProvider::UpnpService::errString ( int  error) const
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.

◆ getEventData()

bool UPnPProvider::UpnpService::getEventData ( bool  all,
std::vector< std::string > &  names,
std::vector< std::string > &  values 
)
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.

Parameters
allIf 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.
namesNames of returned state variable
valuesValues of the returned state variables, parallel to names.

The documentation for this class was generated from the following files: