fw4spl
DumpEditor.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "monitorQt/config.hpp"
10 
11 #include <fwCom/Connection.hpp>
12 
13 #include <fwGui/editor/IEditor.hpp>
14 
15 #include <fwMemory/BufferManager.hpp>
16 
17 #include <fwTools/Failed.hpp>
18 
19 #include <QFutureWatcher>
20 #include <QPointer>
21 #include <QPushButton>
22 #include <QSignalMapper>
23 #include <QTableView>
24 #include <QTableWidget>
25 
26 #include <vector>
27 
28 class QTimer;
29 
30 namespace fwCom
31 {
32 template< typename F >
33 struct Slot;
34 }
35 
36 namespace monitorQt
37 {
38 
42 class MONITORQT_CLASS_API DumpEditor : public QObject,
44 {
45 Q_OBJECT
46 
47 public:
48 
50 
52  MONITORQT_API DumpEditor() noexcept;
53 
55  MONITORQT_API virtual ~DumpEditor() noexcept;
56 
57 protected:
58 
59  typedef ::fwRuntime::ConfigurationElement::sptr Configuration;
60 
62  virtual void starting() override;
63 
65  virtual void stopping() override;
66 
68  virtual void updating() override;
69 
71  virtual void swapping() override;
72 
74  virtual void configuring() override;
75 
77  virtual void info( std::ostream& _sstream ) override;
78 
80  void onUpdate();
81 
82 protected Q_SLOTS:
83 
85  void changeStatus(int);
86 
88  void onRefreshButton();
89 
90  void onBufferInfo();
91 
92 private:
93 
94  typedef ::fwCom::Slot<void ()> UpdateSlotType;
95 
96  QFutureWatcher< ::fwMemory::BufferManager::BufferInfoMapType > m_watcher;
97 
98  // Managed buffers
99  std::vector< const void* const* > m_objectsUID;
100 
102  QTableWidget* m_list;
103 
105  QPushButton* m_refresh;
106 
108  QSignalMapper* m_mapper;
109 
111  QTableView* m_policyEditor;
112 
114  QTableView* m_infoEditor;
115 
116  SPTR(UpdateSlotType) m_updateSlot;
117 
119  ::fwCom::Connection m_connection;
120 
122  QPointer<QTimer> m_updateTimer;
123 };
124 
125 } // monitorQt
#define SPTR(_cls_)
The namespace fwMemory contains tools to manage memory. Use for dump.
Definition: SReader.hpp:20
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Editor to dump or restore selected buffer.
Definition: DumpEditor.hpp:42