Medical Imaging Interaction Toolkit  2021.02.99-121d8b57
Medical Imaging Interaction Toolkit
usServiceRegistrationBase.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 USSERVICEREGISTRATIONBASE_H
23 #define USSERVICEREGISTRATIONBASE_H
24 
25 #include "usServiceProperties.h"
26 #include "usServiceReference.h"
27 
29 
31 
32 class ModulePrivate;
33 class ServiceRegistrationBasePrivate;
34 class ServicePropertiesImpl;
35 
57 {
58 
59 private:
60 
61  typedef ServiceRegistrationBasePrivate* ServiceRegistrationBase::*bool_type;
62 
63 public:
64 
65  ServiceRegistrationBase(const ServiceRegistrationBase& reg);
66 
78  operator bool_type() const;
79 
86  ServiceRegistrationBase& operator=(int null);
87 
88  ~ServiceRegistrationBase();
89 
102  ServiceReferenceBase GetReference(const std::string& interfaceId = std::string()) const;
103 
129  void SetProperties(const ServiceProperties& properties);
130 
162  void Unregister();
163 
175  bool operator<(const ServiceRegistrationBase& o) const;
176 
177  bool operator==(const ServiceRegistrationBase& registration) const;
178 
179  ServiceRegistrationBase& operator=(const ServiceRegistrationBase& registration);
180 
181 
182 private:
183 
184  friend class ServiceRegistry;
185  friend class ServiceReferenceBasePrivate;
186 
187  template<class I1, class I2, class I3> friend class ServiceRegistration;
188 
189  US_HASH_FUNCTION_FRIEND(ServiceRegistrationBase);
190 
196  ServiceRegistrationBase();
197 
198  ServiceRegistrationBase(ServiceRegistrationBasePrivate* registrationPrivate);
199 
200  ServiceRegistrationBase(ModulePrivate* module, const InterfaceMap& service,
201  const ServicePropertiesImpl& props);
202 
203  ServiceRegistrationBasePrivate* d;
204 
205 };
206 
208 
210 
213  return US_HASH_FUNCTION(US_PREPEND_NAMESPACE(ServiceRegistrationBasePrivate)*, arg.d);
216 
217 
218 inline std::ostream& operator<<(std::ostream& os, const US_PREPEND_NAMESPACE(ServiceRegistrationBase)& /*reg*/)
219 {
220  return os << "US_PREPEND_NAMESPACE(ServiceRegistrationBase) object";
221 }
222 
223 #endif // USSERVICEREGISTRATIONBASE_H
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
#define US_HASH_FUNCTION_NAMESPACE_BEGIN
std::map< std::string, void * > InterfaceMap
#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...
US_HASH_FUNCTION_END US_HASH_FUNCTION_NAMESPACE_END std::ostream & operator<<(std::ostream &os, const us::ServiceRegistrationBase &)
#define US_MSVC_PUSH_DISABLE_WARNING(wn)
#define US_MSVC_POP_WARNING
#define US_Core_EXPORT
Definition: usCoreExport.h:21
#define US_HASH_FUNCTION_NAMESPACE_END
#define US_HASH_FUNCTION_END
MITKDICOM_EXPORT void SetProperties(BaseDataPointer image, const FindingsListVectorType &findings)
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
#define US_END_NAMESPACE
#define US_HASH_FUNCTION_FRIEND(type)
#define US_BEGIN_NAMESPACE
US_MSVC_POP_WARNING US_HASH_FUNCTION_NAMESPACE_BEGIN return US_HASH_FUNCTION(us::ServiceRegistrationBasePrivate *, arg.d)
#define US_PREPEND_NAMESPACE(name)