Medical Imaging Interaction Toolkit  2023.12.99-63768887
Medical Imaging Interaction Toolkit
usServiceReferenceBase.h
Go to the documentation of this file.
1 /*============================================================================
2 
3  Library: CppMicroServices
4 
5  Copyright (c) German Cancer Research Center (DKFZ)
6  All rights reserved.
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  https://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 USSERVICEREFERENCEBASE_H
23 #define USSERVICEREFERENCEBASE_H
24 
25 #include <usAny.h>
26 
28 
30 
31 class Module;
32 class ServiceRegistrationBasePrivate;
33 class ServiceReferenceBasePrivate;
34 
44 
45 private:
46 
47  typedef ServiceReferenceBasePrivate* ServiceReferenceBase::*bool_type;
48 
49 public:
50 
52 
59  operator bool_type() const;
60 
65  ServiceReferenceBase& operator=(int null);
66 
68 
86  Any GetProperty(const std::string& key) const;
87 
100  void GetPropertyKeys(std::vector<std::string>& keys) const;
101 
116  Module* GetModule() const;
117 
127  void GetUsingModules(std::vector<Module*>& modules) const;
128 
139  std::string GetInterfaceId() const;
140 
153  bool IsConvertibleTo(const std::string& interfaceid) const;
154 
178  bool operator<(const ServiceReferenceBase& reference) const;
179 
180  bool operator==(const ServiceReferenceBase& reference) const;
181 
182  ServiceReferenceBase& operator=(const ServiceReferenceBase& reference);
183 
184 private:
185 
186  friend class ModulePrivate;
187  friend class ModuleContext;
188  friend class ModuleHooks;
189  friend class ServiceHooks;
190  friend class ServiceObjectsBase;
191  friend class ServiceObjectsBasePrivate;
193  friend class ServiceRegistrationBasePrivate;
194  friend class ServiceListeners;
195  friend class ServiceRegistry;
196  friend class LDAPFilter;
197 
198  template<class S> friend class ServiceReference;
199 
201 
202  std::size_t Hash() const;
203 
210 
211  ServiceReferenceBase(ServiceRegistrationBasePrivate* reg);
212 
213  void SetInterfaceId(const std::string& interfaceId);
214 
215  ServiceReferenceBasePrivate* d;
216 
217 };
218 
220 
222 
226 US_Core_EXPORT std::ostream& operator<<(std::ostream& os, const US_PREPEND_NAMESPACE(ServiceReferenceBase)& serviceRef);
227 
230  return arg.Hash();
233 
234 #endif // USSERVICEREFERENCEBASE_H
usAny.h
US_MSVC_POP_WARNING
#define US_MSVC_POP_WARNING
Definition: usGlobalConfig.h:138
US_HASH_FUNCTION_FRIEND
#define US_HASH_FUNCTION_FRIEND(type)
Definition: usGlobalConfig.h:180
ModuleContext
Definition: usModuleContext.h:91
Hash
US_HASH_FUNCTION_NAMESPACE_BEGIN return arg Hash()
us::ServiceRegistrationBase
Definition: usServiceRegistrationBase.h:56
US_MSVC_PUSH_DISABLE_WARNING
#define US_MSVC_PUSH_DISABLE_WARNING(wn)
Definition: usGlobalConfig.h:137
mitk::modelFit::operator<
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list's first item is lower than the second one's...
Definition: mitkModelFitStaticParameterMap.h:139
US_HASH_FUNCTION_END
#define US_HASH_FUNCTION_END
Definition: usGlobalConfig.h:202
US_HASH_FUNCTION_NAMESPACE_BEGIN
#define US_HASH_FUNCTION_NAMESPACE_BEGIN
Definition: usGlobalConfig.h:184
US_HASH_FUNCTION_BEGIN
#define US_HASH_FUNCTION_BEGIN(type)
Definition: usGlobalConfig.h:197
us::ServiceReference
Definition: usModule.h:40
us::Any
Definition: usAny.h:163
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
us::ServiceReferenceBase
Definition: usServiceReferenceBase.h:43
us::Module
Definition: usModule.h:78
US_BEGIN_NAMESPACE
#define US_BEGIN_NAMESPACE
Definition: usGlobalConfig.h:76
operator<<
US_MSVC_POP_WARNING US_Core_EXPORT std::ostream & operator<<(std::ostream &os, const us::ServiceReferenceBase &serviceRef)
US_END_NAMESPACE
#define US_END_NAMESPACE
Definition: usGlobalConfig.h:77
us::ServiceObjectsBase
Definition: usServiceObjects.h:36
US_PREPEND_NAMESPACE
#define US_PREPEND_NAMESPACE(name)
Definition: usGlobalConfig.h:74
US_HASH_FUNCTION_NAMESPACE_END
#define US_HASH_FUNCTION_NAMESPACE_END
Definition: usGlobalConfig.h:185
US_Core_EXPORT
#define US_Core_EXPORT
Definition: usCoreExport.h:21
us::LDAPFilter
Definition: usLDAPFilter.h:54