Medical Imaging Interaction Toolkit  2021.02.99-89548602
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  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 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 
51  ServiceReferenceBase(const ServiceReferenceBase& ref);
52 
59  operator bool_type() const;
60 
65  ServiceReferenceBase& operator=(int null);
66 
67  ~ServiceReferenceBase();
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 
200  US_HASH_FUNCTION_FRIEND(ServiceReferenceBase);
201 
202  std::size_t Hash() const;
203 
209  ServiceReferenceBase();
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
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
#define US_HASH_FUNCTION_NAMESPACE_BEGIN
#define US_HASH_FUNCTION_BEGIN(type)
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list&#39;s first item is lower than the second one&#39;s...
#define US_MSVC_PUSH_DISABLE_WARNING(wn)
US_MSVC_POP_WARNING US_Core_EXPORT std::ostream & operator<<(std::ostream &os, const us::ServiceReferenceBase &serviceRef)
#define US_MSVC_POP_WARNING
#define US_Core_EXPORT
Definition: usCoreExport.h:21
#define US_HASH_FUNCTION_NAMESPACE_END
Definition: usAny.h:163
#define US_HASH_FUNCTION_END
US_HASH_FUNCTION_NAMESPACE_BEGIN return arg Hash()
#define US_END_NAMESPACE
#define US_HASH_FUNCTION_FRIEND(type)
#define US_BEGIN_NAMESPACE
#define US_PREPEND_NAMESPACE(name)