GEOS  3.9.1dev
bintree/NodeBase.h
Go to the documentation of this file.
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_NODEBASE_H
16 #define GEOS_IDX_BINTREE_NODEBASE_H
17 
18 #include <geos/export.h>
19 #include <vector>
20 
21 // Forward declarations
22 namespace geos {
23 namespace index {
24 namespace bintree {
25 class Node;
26 class Interval;
27 }
28 }
29 }
30 
31 namespace geos {
32 namespace index { // geos::index
33 namespace bintree { // geos::index::bintree
34 
37 
38 public:
39 
40  static int getSubnodeIndex(Interval* interval, double centre);
41 
42  NodeBase();
43 
44  virtual ~NodeBase();
45 
46  virtual std::vector<void*>* getItems();
47 
48  virtual void add(void* item);
49 
50  virtual std::vector<void*>* addAllItems(std::vector<void*>* newItems);
51 
52  virtual std::vector<void*>* addAllItemsFromOverlapping(Interval* interval,
53  std::vector<void*>* resultItems);
54 
55  virtual int depth();
56 
57  virtual int size();
58 
59  virtual int nodeSize();
60 
61 protected:
62 
63  std::vector<void*>* items;
64 
70  Node* subnode[2];
71 
72  virtual bool isSearchMatch(Interval* interval) = 0;
73 
74 private:
75 
76  NodeBase(const NodeBase&) = delete;
77  NodeBase& operator=(const NodeBase&) = delete;
78 
79 };
80 
81 } // namespace geos::index::bintree
82 } // namespace geos::index
83 } // namespace geos
84 
85 #endif // GEOS_IDX_BINTREE_NODEBASE_H
86 
Represents an (1-dimensional) closed interval on the Real number line.
The base class for nodes in a Bintree.
#define GEOS_DLL
Definition: export.h:28
std::vector< void * > * items
Basic namespace for all GEOS functionalities.
A node of a Bintree.