The R-tree is sophisticated enough to support basic insertions and searches.
[aesalon.git] / src / monitor / Aesalon.cpp
blob656b03edfc5f46b6c8e4f8bd99441d64a4372009
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/monitor/Aesalon.cpp
8 */
10 #include "monitor/Coordinator.h"
12 #include "storage/RTree.h"
14 #if 0
15 int main(int argc, char *argv[]) {
18 Monitor::Coordinator coordinator(argv);
19 coordinator.run();
20 return coordinator.returnValue();
22 #endif
25 int main(int argc, char *argv[]) {
26 typedef Storage::RTree<double, int, 1, 8, 2> RTree;
28 RTree rt;
30 RTree::Range range[] = {
31 RTree::Range(-2.0, 2.0)
33 RTree::Bound b(range);
34 rt.insert(b, 0);
36 class Processor : public RTree::SearchProcessor {
37 public:
38 virtual bool process(const RTree::Bound &bound, int value) {
39 Message(Debug, "Found value " << value);
43 Processor p;
45 RTree::Range searchRange[] = {
46 RTree::Range(-3.0, 3.0)
49 RTree::Bound sb(searchRange);
51 rt.search(searchRange, &p);
53 return 0;