GEOS  3.8.0dev
AbstractNode.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_INDEX_STRTREE_ABSTRACTNODE_H
16 #define GEOS_INDEX_STRTREE_ABSTRACTNODE_H
17 
18 #include <cstddef>
19 #include <geos/export.h>
20 #include <geos/index/strtree/Boundable.h> // for inheritance
21 
22 #include <vector>
23 
24 #ifdef _MSC_VER
25 #pragma warning(push)
26 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
27 #endif
28 
29 namespace geos {
30 namespace index { // geos::index
31 namespace strtree { // geos::index::strtree
32 
43 class GEOS_DLL AbstractNode: public Boundable {
44 private:
45  std::vector<Boundable*> childBoundables;
46  int level;
47 public:
48  AbstractNode(int newLevel, size_t capacity = 10);
49  ~AbstractNode() override;
50 
51  // TODO: change signature to return by ref,
52  // document ownership of the return
53  inline std::vector<Boundable*>*
54  getChildBoundables()
55  {
56  return &childBoundables;
57  }
58 
59  // TODO: change signature to return by ref,
60  // document ownership of the return
61  inline const std::vector<Boundable*>*
62  getChildBoundables() const
63  {
64  return &childBoundables;
65  }
66 
79  const void* getBounds() const override;
80 
81  int getLevel();
82 
83  void addChildBoundable(Boundable* childBoundable);
84 
85 protected:
86 
87  virtual void* computeBounds() const = 0;
88 
89  mutable void* bounds;
90 };
91 
92 
93 } // namespace geos::index::strtree
94 } // namespace geos::index
95 } // namespace geos
96 
97 #ifdef _MSC_VER
98 #pragma warning(pop)
99 #endif
100 
101 #endif // GEOS_INDEX_STRTREE_ABSTRACTNODE_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A node of the STR tree.
Definition: AbstractNode.h:43
A spatial object in an AbstractSTRtree.
Definition: Boundable.h:25