Plasma Engine  2.0
Loading...
Searching...
No Matches
MemoryWidget.moc.h
1#pragma once
2
3#include <Foundation/Basics.h>
4#include <Foundation/Containers/Deque.h>
5#include <Foundation/Containers/Map.h>
6#include <Foundation/Strings/String.h>
7#include <Foundation/Time/Time.h>
8#include <Inspector/ui_MemoryWidget.h>
9#include <QAction>
10#include <QGraphicsView>
11#include <QPointer>
12#include <ads/DockWidget.h>
13
14class QTreeWidgetItem;
15
16class plQtMemoryWidget : public ads::CDockWidget, public Ui_MemoryWidget
17{
18public:
19 Q_OBJECT
20
21public:
22 static const plUInt8 s_uiMaxColors = 9;
23
24 plQtMemoryWidget(QWidget* pParent = 0);
25
26 static plQtMemoryWidget* s_pWidget;
27
28private Q_SLOTS:
29
30 void on_ListAllocators_itemChanged(QTreeWidgetItem* item);
31 void on_ComboTimeframe_currentIndexChanged(int index);
32 void on_actionEnableOnlyThis_triggered(bool);
33 void on_actionEnableAll_triggered(bool);
34 void on_actionDisableAll_triggered(bool);
35
36public:
37 static void ProcessTelemetry(void* pUnuseed);
38
39 void ResetStats();
40 void UpdateStats();
41
42private:
43 void CustomContextMenuRequested(const QPoint& pos);
44
45 QGraphicsPathItem* m_pPath[s_uiMaxColors];
46 QGraphicsPathItem* m_pPathMax;
47 QGraphicsScene m_Scene;
48
49 plTime m_LastUsedMemoryStored;
50 plTime m_LastUpdatedAllocatorList;
51
52 plUInt32 m_uiMaxSamples;
53 plUInt32 m_uiDisplaySamples;
54
55 plUInt8 m_uiColorsUsed;
56 bool m_bAllocatorsChanged;
57
58 struct AllocatorData
59 {
60 plDeque<plUInt64> m_UsedMemory;
61 plString m_sName;
62
63 bool m_bStillInUse = true;
64 bool m_bReceivedData = false;
65 bool m_bDisplay = true;
66 plUInt8 m_uiColor = 0xFF;
67 plUInt32 m_uiParentId = plInvalidIndex;
68 plUInt64 m_uiAllocs = 0;
69 plUInt64 m_uiDeallocs = 0;
70 plUInt64 m_uiLiveAllocs = 0;
71 plUInt64 m_uiMaxUsedMemoryRecently = 0;
72 plUInt64 m_uiMaxUsedMemory = 0;
73 QTreeWidgetItem* m_pTreeItem = nullptr;
74 };
75
76 AllocatorData m_Accu;
77
78 plMap<plUInt32, AllocatorData> m_AllocatorData;
79};
80
Definition Deque.h:270
Definition Map.h:408
Definition MemoryWidget.moc.h:17
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12