Poco::UPnP::ServiceDesc

class ServiceCollection

File Information

Library: UPnP/ServiceDesc
Package: ServiceDesc
Header: Poco/UPnP/ServiceDesc/ServiceCollection.h

Description

A ServiceCollection contains all services a UPnP device provides.

Member Summary

Member Functions: addService, clear, findService, loadService, services

Nested Classes

struct ServiceInfo

 

Types

ServiceInfos

typedef std::map < std::string, ServiceInfo::Ptr > ServiceInfos;

Constructors

ServiceCollection

ServiceCollection();

Creates the ServiceManager.

Destructor

~ServiceCollection

~ServiceCollection();

Destroys the ServiceManager.

Member Functions

addService

void addService(
    const std::string & serviceId,
    const std::string & serviceType,
    Service::Ptr pService
);

Adds a Service with the given serviceId and serviceType to the collection of managed services.

clear

void clear();

Removes all services.

findService

ServiceInfo::Ptr findService(
    const std::string & serviceId
) const;

Returns the Service object for the service with the given serviceId, or a null pointer if the service does not exist.

loadService

Service::Ptr loadService(
    const std::string & serviceId,
    const std::string & serviceType,
    std::istream & istr
);

Loads an XML service description for the service with the given serviceId and serviceType from the given input stream and adds it to the collection.

Returns the Service if successful.

loadService

Service::Ptr loadService(
    const std::string & serviceId,
    const std::string & serviceType,
    const Poco::URI & uri
);

Loads an XML service description for the service with the given serviceId and serviceType from the resource identified by URI and adds it to the collection.

Uses the default Poco::URIStreamOpener class to read the service description from the given URI. In order to load service descriptions from a HTTP server, the Poco::Net::HTTPStreamFactory class must have been registered.

Returns the Service if successful.

services inline

ServiceInfos services() const;

Returns a std::map mapping serviceIds to ServiceInfo objects.

Securely control IoT edge devices from anywhere   Connect a Device