libspatialindex API Reference  (git-trunk)
tprtree/Statistics.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Project: libspatialindex - A C++ library for spatial indexing
3  * Author: Marios Hadjieleftheriou, mhadji@gmail.com
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 
30 namespace SpatialIndex
31 {
32  namespace TPRTree
33  {
34  class TPRTree;
35  class Node;
36  class Leaf;
37  class Index;
38 
40  {
41  public:
42  Statistics();
43  Statistics(const Statistics&);
44  ~Statistics() override;
46 
47  //
48  // IStatistics interface
49  //
50  uint64_t getReads() const override;
51  uint64_t getWrites() const override;
52  uint32_t getNumberOfNodes() const override;
53  uint64_t getNumberOfData() const override;
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 
80  uint64_t m_queryResults;
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 }
uint64_t getNumberOfData() const override
uint32_t getNumberOfNodes() const override
friend std::ostream & operator<<(std::ostream &os, const Statistics &s)
virtual uint64_t getMisses() const
Statistics & operator=(const Statistics &)
virtual uint64_t getQueryResults() const
virtual uint64_t getSplits() const
virtual uint32_t getTreeHeight() const
virtual uint64_t getAdjustments() const
uint64_t getWrites() const override
uint64_t getReads() const override
virtual uint32_t getNumberOfNodesInLevel(uint32_t l) const