GEOS  3.8.0dev
bintree/Root.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14
15 #ifndef GEOS_IDX_BINTREE_ROOT_H
16 #define GEOS_IDX_BINTREE_ROOT_H
17
18 #include <geos/export.h>
19 #include <geos/index/bintree/NodeBase.h> // for inheritance
20
21 // Forward declarations
22 namespace geos {
23 namespace index {
24 namespace bintree {
25 class Interval;
26 class Node;
27 }
28 }
29 }
30
31 namespace geos {
32 namespace index { // geos::index
33 namespace bintree { // geos::index::bintree
34
41 class GEOS_DLL Root: public NodeBase {
42
43 private:
44
45  // the singleton root node is centred at the origin.
46  static double origin;
47
48  void insertContained(Node* tree,
49  Interval* itemInterval,
50  void* item);
51
52 public:
53
54  Root() {}
55
56  ~Root() override {}
57
64  void insert(Interval* itemInterval, void* item);
65
66 protected:
67
68  bool
69  isSearchMatch(Interval* /*interval*/) override
70  {
71  return true;
72  }
73 };
74
75 } // namespace geos::index::bintree
76 } // namespace geos::index
77 } // namespace geos
78
79 #endif // GEOS_IDX_BINTREE_ROOT_H
80
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:25
The base class for nodes in a Bintree.
Definition: bintree/NodeBase.h:36
ValueType Root(ValueType x, const ValueType &index, ErrorCode *err=0)
Definition: ttmath.h:2076
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
The root node of a single Bintree.
Definition: bintree/Root.h:41
A node of a Bintree.
Definition: index/bintree/Node.h:35