CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkServiceReference.h
Go to the documentation of this file.
1/*=============================================================================
2
3 Library: CTK
4
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics
7
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19
20=============================================================================*/
21
22#ifndef CTKSERVICEREFERENCE_H
23#define CTKSERVICEREFERENCE_H
24
25#include <QVariant>
26#include <QMetaType>
27
28#include "ctkPlugin.h"
29
30#include "ctkPluginFrameworkExport.h"
31
32
33class ctkServiceRegistrationPrivate;
34class ctkServiceReferencePrivate;
35class ctkServiceEvent;
36
68class CTK_PLUGINFW_EXPORT ctkServiceReference {
69
70public:
71
78
80
87 operator bool() const;
88
94
96
114 QVariant getProperty(const QString& key) const;
115
135 QStringList getPropertyKeys() const;
136
151 QSharedPointer<ctkPlugin> getPlugin() const;
152
163
190 bool operator<(const ctkServiceReference& reference) const;
191
192 bool operator==(const ctkServiceReference& reference) const;
193
195
196
197protected:
198
200 friend class ctkServiceRegistrationPrivate;
201 friend class ctkPluginContext;
202 friend class ctkPluginPrivate;
203 friend class ctkPluginFrameworkListeners;
204 template<class S, class T> friend class ctkServiceTracker;
205 template<class S, class T> friend class ctkServiceTrackerPrivate;
206 template<class S, class R, class T> friend class ctkPluginAbstractTracked;
207
208 friend uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference&);
209
210 ctkServiceReference(ctkServiceRegistrationPrivate* reg);
211
212 ctkServiceReferencePrivate * d_ptr;
213
214private:
215 Q_DECLARE_PRIVATE(ctkServiceReference)
216};
217
222uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference& serviceRef);
223QDebug CTK_PLUGINFW_EXPORT operator<<(QDebug dbg, const ctkServiceReference& serviceRef);
227
228
229#endif // CTKSERVICEREFERENCE_H
bool operator==(const ctkServiceReference &reference) const
QStringList getPropertyKeys() const
QVariant getProperty(const QString &key) const
QList< QSharedPointer< ctkPlugin > > getUsingPlugins() const
ctkServiceReference(const ctkServiceReference &ref)
ctkServiceReferencePrivate * d_ptr
QSharedPointer< ctkPlugin > getPlugin() const
friend uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference &)
ctkServiceReference & operator=(const ctkServiceReference &reference)
ctkServiceReference & operator=(int null)
ctkServiceReference(ctkServiceRegistrationPrivate *reg)
bool operator<(const ctkServiceReference &reference) const
Q_DECLARE_METATYPE(ctkDICOMPersonName)
QDebug CTK_PLUGINFW_EXPORT operator<<(QDebug dbg, const ctkServiceReference &serviceRef)
uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference &serviceRef)