AbstractNode.h

00001 /**********************************************************************
00002  *
00003  * GEOS - Geometry Engine Open Source
00004  * http://geos.osgeo.org
00005  *
00006  * Copyright (C) 2006 Refractions Research Inc.
00007  *
00008  * This is free software; you can redistribute and/or modify it under
00009  * the terms of the GNU Lesser General Public Licence as published
00010  * by the Free Software Foundation. 
00011  * See the COPYING file for more information.
00012  *
00013  **********************************************************************/
00014 
00015 #ifndef GEOS_INDEX_STRTREE_ABSTRACTNODE_H
00016 #define GEOS_INDEX_STRTREE_ABSTRACTNODE_H
00017 
00018 #include <geos/export.h>
00019 #include <geos/index/strtree/Boundable.h> // for inheritance
00020 
00021 #include <vector>
00022 
00023 #ifdef _MSC_VER
00024 #pragma warning(push)
00025 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
00026 #endif
00027 
00028 namespace geos {
00029 namespace index { // geos::index
00030 namespace strtree { // geos::index::strtree
00031 
00042 class GEOS_DLL AbstractNode: public Boundable {
00043 private:
00044         std::vector<Boundable*> childBoundables;
00045         int level;
00046 public:
00047         AbstractNode(int newLevel, int capacity=10);
00048         virtual ~AbstractNode();
00049 
00050         // TODO: change signature to return by ref,
00051         // document ownership of the return
00052         inline std::vector<Boundable*>* getChildBoundables() {
00053                 return &childBoundables;
00054         }
00055 
00056         // TODO: change signature to return by ref,
00057         // document ownership of the return
00058         inline const std::vector<Boundable*>* getChildBoundables() const {
00059                 return &childBoundables;
00060         }
00061 
00074         const void* getBounds() const;
00075 
00076         int getLevel();
00077 
00078         void addChildBoundable(Boundable *childBoundable);
00079 
00080 protected:
00081 
00082         virtual void* computeBounds() const=0;
00083 
00084         mutable void* bounds;
00085 };
00086 
00087 
00088 } // namespace geos::index::strtree
00089 } // namespace geos::index
00090 } // namespace geos
00091 
00092 #ifdef _MSC_VER
00093 #pragma warning(pop)
00094 #endif
00095 
00096 #endif // GEOS_INDEX_STRTREE_ABSTRACTNODE_H

Generated on 23 Sep 2013 for GEOS by  doxygen 1.4.7