File Information
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, demangle, instance, name, properties
Inherited Functions: duplicate, referenceCount, release
Types Aliases
ConstPtr
Ptr
using Ptr = Poco::AutoPtr < ServiceRef >;
Constructors
ServiceRef
ServiceRef(
const std::string & name,
const Properties & props,
Service::Ptr pService
);
Creates the ServiceRef, using the given arguments.
Destructor
~ServiceRef
~ServiceRef();
Destroys the ServiceRef.
Member Functions
castedInstance
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.
demangle
static std::string demangle(
const char * typeName
);
Demangles the given mangled type name, if demangling support is available in the compiler.
Note: On Windows/MSVC, the result of typeid().name already is a demangled type name so this method does nothing.
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
const std::string & name() const;
Returns the name under which the service has been registered.
properties
const Properties & properties() const;
Returns the service properties.
properties
Properties & properties();
Returns the service properties.