Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berry::AbstractSourceProvider Class Reference

#include <berryAbstractSourceProvider.h>

Inheritance diagram for berry::AbstractSourceProvider:
Collaboration diagram for berry::AbstractSourceProvider:

Public Member Functions

 berryObjectMacro (berry::AbstractSourceProvider) void AddSourceProviderListener(ISourceProviderListener *listener) override
 
void RemoveSourceProviderListener (ISourceProviderListener *listener) override
 
virtual void Initialize (IServiceLocator *locator)
 
- Public Member Functions inherited from berry::ISourceProvider
 berryObjectMacro (berry::ISourceProvider) typedef QHash< QString
 
 ~ISourceProvider ()
 
virtual void AddSourceProviderListener (ISourceProviderListener *listener)=0
 
virtual StateMapType GetCurrentState () const =0
 
virtual QList< QString > GetProvidedSourceNames () 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
 

Static Public Attributes

static bool DEBUG
 

Protected Member Functions

void FireSourceChanged (int sourcePriority, const QString &sourceName, Object::ConstPointer sourceValue)
 
void FireSourceChanged (int sourcePriority, const QHash< QString, Object::ConstPointer > &sourceValuesByName)
 
void LogDebuggingInfo (const QString &message)
 
- 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
 

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 ()
 
- Public Attributes inherited from berry::ISourceProvider
Object::ConstPointer StateMapType
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

An implementation of ISourceProvider that provides listener support. Subclasses need only call fireSourceChanged whenever appropriate.

Definition at line 36 of file berryAbstractSourceProvider.h.

Member Function Documentation

berry::AbstractSourceProvider::berryObjectMacro ( berry::AbstractSourceProvider  )
override
void berry::AbstractSourceProvider::FireSourceChanged ( int  sourcePriority,
const QString &  sourceName,
Object::ConstPointer  sourceValue 
)
protected

Notifies all listeners that a single source has changed.

Parameters
sourcePriorityThe source priority that has changed.
sourceNameThe name of the source that has changed; must not be null.
sourceValueThe new value for the source; may be null.

Definition at line 29 of file berryAbstractSourceProvider.cpp.

References berry::ISourceProviderListener::Events::singleSourceChanged.

void berry::AbstractSourceProvider::FireSourceChanged ( int  sourcePriority,
const QHash< QString, Object::ConstPointer > &  sourceValuesByName 
)
protected

Notifies all listeners that multiple sources have changed.

Parameters
sourcePriorityThe source priority that has changed.
sourceValuesByNameThe map of source names (String) to source values (Object) that have changed; must not be null. The names must not be null, but the values may be null.

Definition at line 35 of file berryAbstractSourceProvider.cpp.

References berry::ISourceProviderListener::Events::multipleSourcesChanged.

void berry::AbstractSourceProvider::Initialize ( IServiceLocator locator)
virtual

This method is called when the source provider is instantiated by org.blueberry.ui.services. Clients may override this method to perform initialization.

Parameters
locatorThe global service locator. It can be used to retrieve services like the IContextService

Definition at line 71 of file berryAbstractSourceProvider.cpp.

void berry::AbstractSourceProvider::LogDebuggingInfo ( const QString &  message)
protected

Logs a debugging message in an appropriate manner. If the message is null or the DEBUG is false, then this method does nothing.

Parameters
messageThe debugging message to log; if null, then nothing is logged.

Definition at line 41 of file berryAbstractSourceProvider.cpp.

References BERRY_INFO, and DEBUG.

void berry::AbstractSourceProvider::RemoveSourceProviderListener ( ISourceProviderListener listener)
overridevirtual

Removes a listener from this source provider. This listener will be notified whenever the corresponding source changes.

Parameters
listenerThe listener to remove; must not be null.

Implements berry::ISourceProvider.

Definition at line 60 of file berryAbstractSourceProvider.cpp.

References berry::ISourceProviderListener::Events::RemoveListener().

Member Data Documentation

bool berry::AbstractSourceProvider::DEBUG
static

Whether source providers should print out debugging information to the console when events arrive.

Definition at line 92 of file berryAbstractSourceProvider.h.

Referenced by LogDebuggingInfo().


The documentation for this class was generated from the following files: