Library: OSP
Package: Service
Header: Poco/OSP/Service.h
This is the base class for all services registered with the ServiceRegistry.
All subclasses of Service must override the type() and isA() member functions.
Direct Base Classes: Poco::RefCountedObject
All Base Classes: Poco::RefCountedObject
Known Derived Classes: Poco::OSP::Python::PythonService, Poco::OSP::Web::MediaTypeMapper, Poco::OSP::Web::WebServerDispatcher, Poco::OSP::Web::WebServerService, Poco::OSP::Web::WebSessionService, Poco::OSP::Auth::AuthService, BundleInstallerService, ExtensionPointService, PreferencesService, ServiceFactory
Inherited Functions: duplicate, referenceCount, release
typedef Poco::AutoPtr < Service > Ptr;
Service();
Creates the Service.
~Service();
Destroys the Service.
virtual bool isA(
const std::type_info & otherType
) const;
Returns true if the class is a subclass of the class given by type. Comparison must always be done by type name, not by simply comparing std::type_info object references.
Subclasses must override this member function.
The implementation of isA() is always as follows:
bool MyService::isA(const std::type_info& otherType) const { std::string name(typeid(MyService).name()); return name == otherType.name() || MyBaseClass::isA(otherType); }
virtual const std::type_info & type() const;
Returns the type information for the object's class.
Subclasses must override this member function.
The implementation of isA() is usually as follows:
const std::type_info& MyService::type() const { return typeid(MyService); }
If a service class implements a service interface, the type information for the interface class should be returned instead:
const std::type_info& MyServiceImpl::type() const { return typeid(MyService); }