Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkIRESTObserver.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include <mitkIRESTObserver.h>
14 #include <mitkIRESTManager.h>
15 
16 #include <usModuleContext.h>
17 #include <usGetModuleContext.h>
18 
20 {
21  auto context = us::GetModuleContext();
22  auto managerRef = context->GetServiceReference<IRESTManager>();
23  if (managerRef)
24  {
25  auto manager = context->GetService(managerRef);
26  if (manager)
27  manager->HandleDeleteObserver(this);
28  }
29 }
This is a microservice interface for managing REST requests.
virtual void HandleDeleteObserver(IRESTObserver *observer, const web::uri &uri={})=0
Handles the deletion of an observer for all or a specific uri.
virtual ~IRESTObserver()
Deletes an observer and calls HandleDeleteObserver() in RESTManager class.
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.