Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
berry::IServiceLocator Struct Referenceabstract

#include <berryIServiceLocator.h>

Inheritance diagram for berry::IServiceLocator:
Collaboration diagram for berry::IServiceLocator:

Public Member Functions

 berryObjectMacro (berry::IServiceLocator, Object)
 
 ~IServiceLocator () override
 
template<class S >
S * GetService ()
 
template<class S >
bool HasService () const
 
virtual ObjectGetService (const QString &api)=0
 
virtual bool HasService (const QString &api) const =0
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual QString ToString () const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Additional Inherited Members

- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A component with which one or more services are registered. The services can be retrieved from this locator using the service type. For example:

IHandlerService* service = workbenchWindow->GetService<IHandlerService>();

This interface is not to be implemented or extended by clients.

Definition at line 43 of file berryIServiceLocator.h.

Constructor & Destructor Documentation

◆ ~IServiceLocator()

berry::IServiceLocator::~IServiceLocator ( )
override

Member Function Documentation

◆ berryObjectMacro()

berry::IServiceLocator::berryObjectMacro ( berry::IServiceLocator  ,
Object   
)

◆ GetService() [1/2]

template<class S >
S* berry::IServiceLocator::GetService ( )
inline

Retrieves the service corresponding to the given API.

Template Parameters
SThis is the interface that the service implements. Must not be null.
Returns
The service, or null if no such service could be found.

Definition at line 60 of file berryIServiceLocator.h.

References BERRY_WARN, and berry::Object::GetClassName().

◆ GetService() [2/2]

virtual Object* berry::IServiceLocator::GetService ( const QString &  api)
pure virtual

◆ HasService() [1/2]

template<class S >
bool berry::IServiceLocator::HasService ( ) const
inline

Whether this service exists within the scope of this service locator. This does not include looking for the service within the scope of the parents. This method can be used to determine whether a particular service supports nesting in this scope.

Template Parameters
SThis is the interface that the service implements. Must not be null.
Returns
true iff the service locator can find a service for the given interface; false otherwise.

Definition at line 92 of file berryIServiceLocator.h.

◆ HasService() [2/2]

virtual bool berry::IServiceLocator::HasService ( const QString &  api) const
pure virtual

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