From 4f825dac6cfc648c803bd549127bebad34725dcf Mon Sep 17 00:00:00 2001 From: Ethereal Date: Sat, 19 Feb 2011 13:30:57 -0700 Subject: [PATCH] Started implementing various things. I have, however, come to the conclusion that there will be quite a bit of shared code between the monitor and the visualizer. Placing some of these shared classes in a common source directory may be a good idea. (Some examples include the rtree, mempool, and configuration system implementations.) --- include/visualizer/RootWindow.h | 4 +- include/visualizer/storage/MemoryPool.h | 35 ++++++++++++ include/visualizer/storage/MemoryPoolEntry.h | 27 +++++++++ include/visualizer/storage/MemoryPoolItem.h | 26 +++++++++ include/visualizer/storage/RTree.h | 66 ++++++++++++++++++++++ include/visualizer/visualization/AbstractObject.h | 28 +++++++++ .../visualization/AbstractRangeMatcher.h | 30 ++++++++++ .../visualization/AbstractVisualization.h | 28 +++++++++ include/visualizer/visualization/Viewport.h | 29 ++++++++++ visualizer/src/RootWindow.cpp | 7 +-- visualizer/src/storage/MemoryPool.cpp | 20 +++++++ visualizer/src/storage/MemoryPoolEntry.cpp | 20 +++++++ visualizer/src/storage/MemoryPoolItem.cpp | 20 +++++++ visualizer/src/storage/RTree.cpp | 27 +++++++++ visualizer/src/visualization/AbstractObject.cpp | 20 +++++++ .../src/visualization/AbstractRangeMatcher.cpp | 20 +++++++ .../src/visualization/AbstractVisualization.cpp | 20 +++++++ visualizer/src/visualization/Viewport.cpp | 26 +++++++++ 18 files changed, 446 insertions(+), 7 deletions(-) create mode 100644 include/visualizer/storage/MemoryPool.h create mode 100644 include/visualizer/storage/MemoryPoolEntry.h create mode 100644 include/visualizer/storage/MemoryPoolItem.h create mode 100644 include/visualizer/storage/RTree.h create mode 100644 include/visualizer/visualization/AbstractObject.h create mode 100644 include/visualizer/visualization/AbstractRangeMatcher.h create mode 100644 include/visualizer/visualization/AbstractVisualization.h create mode 100644 include/visualizer/visualization/Viewport.h create mode 100644 visualizer/src/storage/MemoryPool.cpp create mode 100644 visualizer/src/storage/MemoryPoolEntry.cpp create mode 100644 visualizer/src/storage/MemoryPoolItem.cpp create mode 100644 visualizer/src/storage/RTree.cpp create mode 100644 visualizer/src/visualization/AbstractObject.cpp create mode 100644 visualizer/src/visualization/AbstractRangeMatcher.cpp create mode 100644 visualizer/src/visualization/AbstractVisualization.cpp create mode 100644 visualizer/src/visualization/Viewport.cpp diff --git a/include/visualizer/RootWindow.h b/include/visualizer/RootWindow.h index ce02f8e..2f5dfe7 100644 --- a/include/visualizer/RootWindow.h +++ b/include/visualizer/RootWindow.h @@ -12,14 +12,14 @@ #ifndef AesalonVisualizer_RootWindow_H #define AesalonVisualizer_RootWindow_H -#include #include +#include namespace Visualizer { class RootWindow : public QMainWindow { Q_OBJECT private: - QSplitter *m_splitter; + QMdiArea *m_mdiArea; public: RootWindow(); virtual ~RootWindow(); diff --git a/include/visualizer/storage/MemoryPool.h b/include/visualizer/storage/MemoryPool.h new file mode 100644 index 0000000..86e9fe8 --- /dev/null +++ b/include/visualizer/storage/MemoryPool.h @@ -0,0 +1,35 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/storage/MemoryPool.h + +*/ + +#ifndef AesalonVisualizer_Storage_MemoryPool_H +#define AesalonVisualizer_Storage_MemoryPool_H + +#include + +namespace Visualizer { +namespace Storage { + +class MemoryPool { +private: + typedef std::list PoolList; + PoolList m_poolList; +public: + MemoryPool(); + ~MemoryPool(); + + template + Type *allocate(); +}; + +} // namespace Storage +} // namespace Visualizer + +#endif diff --git a/include/visualizer/storage/MemoryPoolEntry.h b/include/visualizer/storage/MemoryPoolEntry.h new file mode 100644 index 0000000..2fe3a91 --- /dev/null +++ b/include/visualizer/storage/MemoryPoolEntry.h @@ -0,0 +1,27 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/storage/MemoryPoolEntry.h + +*/ + +#ifndef AesalonVisualizer_Storage_MemoryPoolEntry_H +#define AesalonVisualizer_Storage_MemoryPoolEntry_H + +namespace Visualizer { +namespace Storage { + +class MemoryPoolEntry { +public: + MemoryPoolEntry(); + ~MemoryPoolEntry(); +}; + +} // namespace Storage +} // namespace Visualizer + +#endif diff --git a/include/visualizer/storage/MemoryPoolItem.h b/include/visualizer/storage/MemoryPoolItem.h new file mode 100644 index 0000000..f6ff0c5 --- /dev/null +++ b/include/visualizer/storage/MemoryPoolItem.h @@ -0,0 +1,26 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/storage/MemoryPoolItem.h + +*/ + +#ifndef AesalonVisualizer_Storage_MemoryPoolItem_H +#define AesalonVisualizer_Storage_MemoryPoolItem_H + +namespace Visualizer { +namespace Storage { + +class MemoryPoolItem { +public: + virtual ~MemoryPoolItem() {} +}; + +} // namespace Storage +} // namespace Visualizer + +#endif diff --git a/include/visualizer/storage/RTree.h b/include/visualizer/storage/RTree.h new file mode 100644 index 0000000..adebd35 --- /dev/null +++ b/include/visualizer/storage/RTree.h @@ -0,0 +1,66 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/storage/RTree.h + +*/ + +#ifndef AesalonVisualizer_Storage_RTree_H +#define AesalonVisualizer_Storage_RTree_H + +namespace Visualizer { +namespace Storage { + +template +class RTree { +public: + class Range { + private: + RangeType m_from; + RangeType m_to; + public: + Range(RangeType from, RangeType to) : m_from(from), m_to(to) {} + + RangeType from() const { return m_from; } + RangeType to() const { return m_to; } + }; + + class Bound { + private: + Range m_range[Dimensions]; + public: + Bound(Range ranges[Dimensions]) { + for(int i = 0; i < Dimensions; i ++) { + m_range[i] = ranges[i]; + } + } + + void setRange(int dimension, Range newRange) { + m_range[dimension] = newRange; + } + const Range &range(int dimension) const { + return m_range[dimension]; + } + }; +protected: + class Node { + private: + Bound m_bound; + public: + + }; +private: + +public: + RTree(); + ~RTree(); +}; + +} // namespace Storage +} // namespace Visualizer + +#endif diff --git a/include/visualizer/visualization/AbstractObject.h b/include/visualizer/visualization/AbstractObject.h new file mode 100644 index 0000000..89ed5df --- /dev/null +++ b/include/visualizer/visualization/AbstractObject.h @@ -0,0 +1,28 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/visualization/AbstractObject.h + +*/ + +#ifndef AesalonVisualizer_Visualization_AbstractObject_H +#define AesalonVisualizer_Visualization_AbstractObject_H + +namespace Visualizer { +namespace Visualization { + +class AbstractObject { +public: + virtual ~AbstractObject() {} + + virtual void paint() = 0; +}; + +} // namespace Visualization +} // namespace Visualizer + +#endif diff --git a/include/visualizer/visualization/AbstractRangeMatcher.h b/include/visualizer/visualization/AbstractRangeMatcher.h new file mode 100644 index 0000000..e7bc465 --- /dev/null +++ b/include/visualizer/visualization/AbstractRangeMatcher.h @@ -0,0 +1,30 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/visualization/AbstractRangeMatcher.h + +*/ + +#ifndef AesalonVisualizer_Visualization_AbstractRangeMatcher_H +#define AesalonVisualizer_Visualization_AbstractRangeMatcher_H + +#include "AbstractObject.h" + +namespace Visualizer { +namespace Visualization { + +class AbstractRangeMatcher { +public: + virtual ~AbstractRangeMatcher() {} + + virtual bool matches(AbstractObject *object) = 0; +}; + +} // namespace Visualization +} // namespace Visualizer + +#endif diff --git a/include/visualizer/visualization/AbstractVisualization.h b/include/visualizer/visualization/AbstractVisualization.h new file mode 100644 index 0000000..5747d06 --- /dev/null +++ b/include/visualizer/visualization/AbstractVisualization.h @@ -0,0 +1,28 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/visualization/AbstractVisualization.h + +*/ + +#ifndef AesalonVisualizer_Visualization_AbstractVisualization_H +#define AesalonVisualizer_Visualization_AbstractVisualization_H + +namespace Visualizer { +namespace Visualization { + +class AbstractVisualization { +public: + virtual ~AbstractVisualization() {} + + virtual void objects(); +}; + +} // namespace Visualization +} // namespace Visualizer + +#endif diff --git a/include/visualizer/visualization/Viewport.h b/include/visualizer/visualization/Viewport.h new file mode 100644 index 0000000..956e115 --- /dev/null +++ b/include/visualizer/visualization/Viewport.h @@ -0,0 +1,29 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file include/visualizer/visualization/Viewport.h + +*/ + +#include + +#ifndef AesalonVisualizer_Visualization_Viewport_H +#define AesalonVisualizer_Visualization_Viewport_H + +namespace Visualizer { +namespace Visualization { + +class Viewport : public QMdiSubWindow { Q_OBJECT +public: + Viewport(); + ~Viewport(); +}; + +} // namespace Visualization +} // namespace Visualizer + +#endif diff --git a/visualizer/src/RootWindow.cpp b/visualizer/src/RootWindow.cpp index 7bbfbeb..25ca10c 100644 --- a/visualizer/src/RootWindow.cpp +++ b/visualizer/src/RootWindow.cpp @@ -46,11 +46,8 @@ void RootWindow::initialSetup() { tr("&Close")); connect(action, SIGNAL(triggered(bool)), SLOT(close())); - m_splitter = new QSplitter(); - - m_splitter->setOrientation(Qt::Horizontal); - - setCentralWidget(m_splitter); + m_mdiArea = new QMdiArea(this); + setCentralWidget(m_mdiArea); } void RootWindow::newRootWindow() { diff --git a/visualizer/src/storage/MemoryPool.cpp b/visualizer/src/storage/MemoryPool.cpp new file mode 100644 index 0000000..2ba3022 --- /dev/null +++ b/visualizer/src/storage/MemoryPool.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/storage/MemoryPool.cpp + +*/ + +#include "storage/MemoryPool.h" + +namespace Visualizer { +namespace Storage { + + + +} // namespace Storage +} // namespace Visualizer diff --git a/visualizer/src/storage/MemoryPoolEntry.cpp b/visualizer/src/storage/MemoryPoolEntry.cpp new file mode 100644 index 0000000..7415e8f --- /dev/null +++ b/visualizer/src/storage/MemoryPoolEntry.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/storage/MemoryPoolEntry.cpp + +*/ + +#include "storage/MemoryPoolEntry.h" + +namespace Visualizer { +namespace Storage { + + + +} // namespace Storage +} // namespace Visualizer diff --git a/visualizer/src/storage/MemoryPoolItem.cpp b/visualizer/src/storage/MemoryPoolItem.cpp new file mode 100644 index 0000000..de8e4a7 --- /dev/null +++ b/visualizer/src/storage/MemoryPoolItem.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/storage/MemoryPoolItem.cpp + +*/ + +#include "storage/MemoryPoolItem.h" + +namespace Visualizer { +namespace Storage { + + + +} // namespace Storage +} // namespace Visualizer diff --git a/visualizer/src/storage/RTree.cpp b/visualizer/src/storage/RTree.cpp new file mode 100644 index 0000000..ecf318a --- /dev/null +++ b/visualizer/src/storage/RTree.cpp @@ -0,0 +1,27 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/storage/RTree.cpp + +*/ + +#include "storage/RTree.h" + +namespace Visualizer { +namespace Storage { + +/*template +const typename RTree::Range & + RTree::Bound::range(int dimension) const { + + +}*/ + + + +} // namespace Storage +} // namespace Visualizer diff --git a/visualizer/src/visualization/AbstractObject.cpp b/visualizer/src/visualization/AbstractObject.cpp new file mode 100644 index 0000000..1ad163a --- /dev/null +++ b/visualizer/src/visualization/AbstractObject.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/visualization/AbstractObject.cpp + +*/ + +#include "visualization/AbstractObject.h" + +namespace Visualizer { +namespace Visualization { + + + +} // namespace Visualization +} // namespace Visualizer diff --git a/visualizer/src/visualization/AbstractRangeMatcher.cpp b/visualizer/src/visualization/AbstractRangeMatcher.cpp new file mode 100644 index 0000000..ee015f4 --- /dev/null +++ b/visualizer/src/visualization/AbstractRangeMatcher.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/visualization/AbstractRangeMatcher.cpp + +*/ + +#include "visualization/AbstractRangeMatcher.h" + +namespace Visualizer { +namespace Visualization { + + + +} // namespace Visualization +} // namespace Visualizer diff --git a/visualizer/src/visualization/AbstractVisualization.cpp b/visualizer/src/visualization/AbstractVisualization.cpp new file mode 100644 index 0000000..04a5447 --- /dev/null +++ b/visualizer/src/visualization/AbstractVisualization.cpp @@ -0,0 +1,20 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/visualization/AbstractVisualization.cpp + +*/ + +#include "visualization/AbstractVisualization.h" + +namespace Visualizer { +namespace Visualization { + + + +} // namespace Visualization +} // namespace Visualizer diff --git a/visualizer/src/visualization/Viewport.cpp b/visualizer/src/visualization/Viewport.cpp new file mode 100644 index 0000000..debb220 --- /dev/null +++ b/visualizer/src/visualization/Viewport.cpp @@ -0,0 +1,26 @@ +/** + Aesalon, a tool to visualize a program's behaviour at run-time. + Copyright (C) 2010, Aesalon Development Team. + + Aesalon is distributed under the terms of the GNU GPLv3. For more + licensing information, see the file LICENSE included with the distribution. + + @file visualizer/src/visualization/Viewport.cpp + +*/ + +#include "visualization/Viewport.h" + +namespace Visualizer { +namespace Visualization { + +Viewport::Viewport() { + +} + +Viewport::~Viewport() { + +} + +} // namespace Visualization +} // namespace Visualizer -- 2.11.4.GIT