Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryAbstractSourceProvider.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include <berryLog.h>
18 
21 
22 #include <Poco/Exception.h>
23 
24 namespace berry
25 {
26 
27 bool AbstractSourceProvider::DEBUG = false; //Policy.DEBUG_SOURCES;
28 
30  const QString &sourceName, Object::ConstPointer sourceValue)
31 {
32  sourceEvents.singleSourceChanged(sourcePriority, sourceName, sourceValue);
33 }
34 
36  const QHash<QString, Object::ConstPointer> &sourceValuesByName)
37 {
38  sourceEvents.multipleSourcesChanged(sourcePriority, sourceValuesByName);
39 }
40 
41 void AbstractSourceProvider::LogDebuggingInfo(const QString& message)
42 {
43  if (DEBUG && (message != ""))
44  {
45  BERRY_INFO << "SOURCES >>> " << message;
46  }
47 }
48 
50  ISourceProviderListener* listener)
51 {
52  if (listener == nullptr)
53  {
54  throw Poco::NullPointerException("The listener cannot be null");
55  }
56 
57  sourceEvents.AddListener(listener);
58 }
59 
61  ISourceProviderListener* listener)
62 {
63  if (listener == nullptr)
64  {
65  throw Poco::NullPointerException("The listener cannot be null");
66  }
67 
68  sourceEvents.RemoveListener(listener);
69 }
70 
72 {
73 }
74 
75 }
Message2< int, const QHash< QString, Object::ConstPointer > & > multipleSourcesChanged
void LogDebuggingInfo(const QString &message)
virtual void Initialize(IServiceLocator *locator)
Message3< int, const QString &, Object::ConstPointer > singleSourceChanged
#define BERRY_INFO
Definition: berryLog.h:24
void RemoveSourceProviderListener(ISourceProviderListener *listener) override
void FireSourceChanged(int sourcePriority, const QString &sourceName, Object::ConstPointer sourceValue)
virtual void AddSourceProviderListener(ISourceProviderListener *listener)=0