Library: OSP
Package: Service
Header: Poco/OSP/ServiceRef.h
ServiceRef objects are used by the ServiceRegistry class to manage service registrations.
Direct Base Classes: Poco::RefCountedObject
All Base Classes: Poco::RefCountedObject
Member Functions: castedInstance, instance, name, properties
Inherited Functions: duplicate, referenceCount, release
typedef Poco::AutoPtr < ServiceRef > Ptr;
ServiceRef(
const std::string & name,
const Properties & props,
Service::Ptr pService
);
Creates the ServiceRef, using the given arguments.
~ServiceRef();
Destroys the ServiceRef.
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.
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.
const std::string & name() const;
Returns the name under which the service has been registered.
const Properties & properties() const;
Returns the service properties.
Properties & properties();
Returns the service properties.