QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
Statistics.h
Go to the documentation of this file.
1/******************************************************************************
2 * Project: libspatialindex - A C++ library for spatial indexing
3 * Author: Marios Hadjieleftheriou, [email protected]
4 ******************************************************************************
5 * Copyright (c) 2002, Marios Hadjieleftheriou
6 *
7 * All rights reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26******************************************************************************/
27
28#pragma once
29
30namespace SpatialIndex
31{
32 namespace TPRTree
33 {
34 class TPRTree;
35 class Node;
36 class Leaf;
37 class Index;
38
40 {
41 public:
44 virtual ~Statistics();
46
47 //
48 // IStatistics interface
49 //
50 virtual uint64_t getReads() const;
51 virtual uint64_t getWrites() const;
52 virtual uint32_t getNumberOfNodes() const;
53 virtual uint64_t getNumberOfData() const;
54
55 virtual uint64_t getSplits() const;
56 virtual uint64_t getHits() const;
57 virtual uint64_t getMisses() const;
58 virtual uint64_t getAdjustments() const;
59 virtual uint64_t getQueryResults() const;
60 virtual uint32_t getTreeHeight() const;
61 virtual uint32_t getNumberOfNodesInLevel(uint32_t l) const;
62
63 private:
64 void reset();
65
66 uint64_t m_reads;
67
68 uint64_t m_writes;
69
70 uint64_t m_splits;
71
72 uint64_t m_hits;
73
74 uint64_t m_misses;
75
76 uint32_t m_nodes;
77
78 uint64_t m_adjustments;
79
81
82 uint64_t m_data;
83
84 uint32_t m_treeHeight;
85
86 std::vector<uint32_t> m_nodesInLevel;
87
88 friend class TPRTree;
89 friend class Node;
90 friend class Index;
91 friend class Leaf;
92 friend class BulkLoader;
93
94 friend std::ostream& operator<<(std::ostream& os, const Statistics& s);
95 }; // Statistics
96
97 std::ostream& operator<<(std::ostream& os, const Statistics& s);
98 }
99}
Definition Index.h:34
Definition SpatialIndex.h:182
Definition Index.h:35
Definition Leaf.h:35
Definition Node.h:42
Definition Statistics.h:40
uint64_t m_misses
Definition Statistics.h:74
virtual uint64_t getReads() const
virtual uint32_t getNumberOfNodesInLevel(uint32_t l) const
uint64_t m_queryResults
Definition Statistics.h:80
virtual uint64_t getHits() const
uint64_t m_writes
Definition Statistics.h:68
std::vector< uint32_t > m_nodesInLevel
Definition Statistics.h:86
virtual uint64_t getAdjustments() const
virtual uint64_t getSplits() const
uint64_t m_splits
Definition Statistics.h:70
uint64_t m_reads
Definition Statistics.h:66
uint64_t m_data
Definition Statistics.h:82
Statistics(const Statistics &)
virtual uint32_t getTreeHeight() const
uint64_t m_hits
Definition Statistics.h:72
friend std::ostream & operator<<(std::ostream &os, const Statistics &s)
virtual uint64_t getNumberOfData() const
Statistics & operator=(const Statistics &)
virtual uint32_t getNumberOfNodes() const
uint32_t m_nodes
Definition Statistics.h:76
uint32_t m_treeHeight
Definition Statistics.h:84
friend class BulkLoader
Definition Statistics.h:92
virtual uint64_t getMisses() const
virtual uint64_t getQueryResults() const
uint64_t m_adjustments
Definition Statistics.h:78
virtual uint64_t getWrites() const
Definition TPRTree.h:39
std::ostream & operator<<(std::ostream &os, const Statistics &s)
Definition CustomStorage.h:34
char s
Definition opennurbs_string.cpp:32