MCPcopy Create free account
hub / github.com/MITK/MITK / RegisterAsMicroservice

Method RegisterAsMicroservice

Modules/Core/src/Rendering/mitkAnnotation.cpp:327–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void mitk::Annotation::RegisterAsMicroservice(us::ServiceProperties props)
328{
329 if (m_ServiceRegistration)
330 {
331 try
332 {
333 if (m_ServiceRegistration.IsAvailable())
334 m_ServiceRegistration.Unregister();
335 }
336 catch (...)
337 {
338 // Best-effort cleanup of the stale handle; proceed with the fresh
339 // registration even if the previous one cannot be torn down cleanly.
340 }
341 }
342 us::ModuleContext *context = us::GetModuleContext();
343 // Define ServiceProps
344 mitk::UIDGenerator uidGen = mitk::UIDGenerator("org.mitk.services.Annotation.id_");
345 props[US_PROPKEY_ID] = uidGen.GetUID();
346 m_ServiceRegistration = context->RegisterService(this, props);
347}
348
349void mitk::Annotation::UnRegisterMicroservice()
350{

Callers 2

AddAnnotationMethod · 0.80
AddAnnotationMethod · 0.80

Calls 5

GetModuleContextFunction · 0.85
IsAvailableMethod · 0.80
UnregisterMethod · 0.45
GetUIDMethod · 0.45
RegisterServiceMethod · 0.45

Tested by

no test coverage detected