Poco::OSP

class ServiceRef

Library: OSP
Package: Service
Header: Poco/OSP/ServiceRef.h

Description

ServiceRef objects are used by the ServiceRegistry class to manage service registrations.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: castedInstance, instance, name, properties

Inherited Functions: duplicate, referenceCount, release

Types

ConstPtr

typedef const Ptr ConstPtr;

Ptr

typedef Poco::AutoPtr < ServiceRef > Ptr;

Constructors

ServiceRef

ServiceRef(
    const std::string & name,
    const Properties & props,
    Service::Ptr pService
);

Creates the ServiceRef, using the given arguments.

Destructor

~ServiceRef protected virtual

~ServiceRef();

Destroys the ServiceRef.

Member Functions

castedInstance inline

template < class Svc > Poco::AutoPtr < Svc > castedInstance() const;

Returns an instance of the Service.

If a ServiceFactory has been registered for the service, creates and returns a new instance of the Service class. Otherwise, returns the registered Service object.

Throws a Poco::BadCastException if the service object cannot be casted to the desired type.

instance

Service::Ptr instance() const;

Returns an instance of the Service.

If a ServiceFactory has been registered for the service, creates and returns a new instance of the Service class. Otherwise, returns the registered Service object.

name inline

const std::string & name() const;

Returns the name under which the service has been registered.

properties inline

const Properties & properties() const;

Returns the service properties.

properties

Properties & properties();

Returns the service properties.

Securely control IoT edge devices from anywhere   Connect a Device