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 
33 class ctkServiceRegistrationPrivate;
34 class ctkServiceReferencePrivate;
35 class ctkServiceEvent;
36 
68 class CTK_PLUGINFW_EXPORT ctkServiceReference {
69 
70 public:
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 
197 protected:
198 
199  friend class ctkLDAPSearchFilter;
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 
214 private:
215  Q_DECLARE_PRIVATE(ctkServiceReference)
216 };
217 
222 uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference& serviceRef);
223 QDebug CTK_PLUGINFW_EXPORT operator<<(QDebug dbg, const ctkServiceReference& serviceRef);
227 
228 
229 #endif // CTKSERVICEREFERENCE_H
QSharedPointer< ctkPlugin > getPlugin() const
ctkServiceReference & operator=(int null)
bool operator==(const ctkServiceReference &reference) const
QStringList getPropertyKeys() const
QList< QSharedPointer< ctkPlugin > > getUsingPlugins() const
QVariant getProperty(const QString &key) const
ctkServiceReference(const ctkServiceReference &ref)
ctkServiceReferencePrivate * d_ptr
ctkServiceReference & operator=(const ctkServiceReference &reference)
friend uint CTK_PLUGINFW_EXPORT qHash(const ctkServiceReference &)
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)