CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxSessionStorageServiceProxy.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXSESSIONSTORAGESERVICEPROXY_H
13 #define CXSESSIONSTORAGESERVICEPROXY_H
14 
15 #include "cxResourceExport.h"
17 
19 
20 
21 namespace cx
22 {
23 
27 class cxResource_EXPORT SessionStorageServiceProxy : public SessionStorageService
28 {
29 public:
30  static SessionStorageServicePtr create(ctkPluginContext *pluginContext);
31  SessionStorageServiceProxy(ctkPluginContext *pluginContext);
32 
34  virtual void load(QString dir);
35  virtual void save();
36  virtual void clear();
37  virtual bool isValid() const;
38  virtual QString getRootFolder() const;
39  virtual bool isNull() const;
40 
41 private:
42  void initServiceListener();
43  void onServiceAdded(SessionStorageService* service);
44  void onServiceRemoved(SessionStorageService *service);
45 
46  ctkPluginContext *mPluginContext;
47  SessionStorageServicePtr mService;
48  boost::shared_ptr<ServiceTrackerListener<SessionStorageService> > mServiceListener;
49 };
50 
51 } // namespace cx
52 
53 #endif // CXSESSIONSTORAGESERVICEPROXY_H
boost::shared_ptr< class SessionStorageService > SessionStorageServicePtr
Namespace for all CustusX production code.