Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berry::IServiceFactory Struct Referenceabstract

#include <berryIServiceFactory.h>

Public Member Functions

virtual ~IServiceFactory ()
 
template<class S >
S * Create (IServiceLocator *parentLocator, IServiceLocator *locator) const
 
virtual ObjectCreate (const QString &serviceInterface, IServiceLocator *parentLocator, IServiceLocator *locator) const =0
 

Detailed Description

A factory for creating services for use with the org.blueberry.ui.services extension point. You are given a service locator to look up other services, and can retrieve your parent service (if one has already been created).

Definition at line 33 of file berryIServiceFactory.h.

Constructor & Destructor Documentation

◆ ~IServiceFactory()

virtual berry::IServiceFactory::~IServiceFactory ( )
virtual

Member Function Documentation

◆ Create() [1/2]

virtual Object* berry::IServiceFactory::Create ( const QString &  serviceInterface,
IServiceLocator parentLocator,
IServiceLocator locator 
) const
pure virtual

◆ Create() [2/2]

template<class S >
S* berry::IServiceFactory::Create ( IServiceLocator parentLocator,
IServiceLocator locator 
) const
inline

When a service locator cannot find a service it will request one from the registry, which will call this factory create method.

You can use the locator to get any needed services and a parent service locator will be provided if you need access to the parent service. If the parent object return from the parent locator is not null it can be cast to the service interface that is requested. The parent service locator will only return the serviceInterface service.

Parameters
parentLocatorA locator that can return a parent service instance if desired. The parent service can be cast to serviceInterface. Will not be null.
locatorthe service locator which can be used to retrieve dependent services. Will not be null
Returns
the created service or null

Definition at line 58 of file berryIServiceFactory.h.


The documentation for this struct was generated from the following file: