Medical Imaging Interaction Toolkit  2023.12.99-ed252ae7
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  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 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 
66 
78  operator bool_type() const;
79 
86  ServiceRegistrationBase& operator=(int null);
87 
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 
190 
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
US_HASH_FUNCTION
US_MSVC_POP_WARNING US_HASH_FUNCTION_NAMESPACE_BEGIN return US_HASH_FUNCTION(us::ServiceRegistrationBasePrivate *, arg.d)
us::ServiceProperties
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
Definition: usServiceProperties.h:42
usServiceProperties.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
mitk::DICOMIOHelper::SetProperties
MITKDICOM_EXPORT void SetProperties(BaseData *image, const FindingsListVectorType &findings)
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
operator<<
US_HASH_FUNCTION_END US_HASH_FUNCTION_NAMESPACE_END std::ostream & operator<<(std::ostream &os, const us::ServiceRegistrationBase &)
Definition: usServiceRegistrationBase.h:218
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
us::ServiceReferenceBase
Definition: usServiceReferenceBase.h:43
usServiceReference.h
US_BEGIN_NAMESPACE
#define US_BEGIN_NAMESPACE
Definition: usGlobalConfig.h:76
US_END_NAMESPACE
#define US_END_NAMESPACE
Definition: usGlobalConfig.h:77
US_PREPEND_NAMESPACE
#define US_PREPEND_NAMESPACE(name)
Definition: usGlobalConfig.h:74
us::ServiceRegistration
Definition: usServiceRegistration.h:48
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::InterfaceMap
std::map< std::string, void * > InterfaceMap
Definition: usServiceInterface.h:138