GEOS  3.14.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 #pragma once
16 
17 #include <geos/export.h>
18 #include <geos/index/bintree/NodeBase.h> // for inheritance
19 
20 // Forward declarations
21 namespace geos {
22 namespace index {
23 namespace bintree {
24 class Interval;
25 class Node;
26 }
27 }
28 }
29 
30 namespace geos {
31 namespace index { // geos::index
32 namespace bintree { // geos::index::bintree
33 
40 class GEOS_DLL Root: public NodeBase {
41 
42 private:
43 
44  // the singleton root node is centred at the origin.
45  static double origin;
46 
47  void insertContained(Node* tree,
48  Interval* itemInterval,
49  void* item);
50 
51 public:
52 
53  Root() {}
54 
55  ~Root() override {}
56 
63  void insert(Interval* itemInterval, void* item);
64 
65 protected:
66 
67  bool
68  isSearchMatch(Interval* /*interval*/) override
69  {
70  return true;
71  }
72 };
73 
74 } // namespace geos::index::bintree
75 } // namespace geos::index
76 } // namespace geos
77 
Represents an (1-dimensional) closed interval on the Real number line.
Definition: bintree/Interval.h:24
The base class for nodes in a Bintree.
Definition: bintree/NodeBase.h:35
A node of a Bintree.
Definition: index/bintree/Node.h:34
The root node of a single Bintree.
Definition: bintree/Root.h:40
void insert(Interval *itemInterval, void *item)
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25