From 84ffedd95d73d413604ed4efe9d4787dda17ae5a Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Fri, 9 May 2014 16:47:42 +0200 Subject: [PATCH] replace boost::shared_ptr --- DataStructures/StaticRTree.h | 9 +++++---- Server/DataStructures/InternalDataFacade.h | 11 ++++------- Server/DataStructures/SharedDataFacade.h | 18 ++++++++---------- prepare.cpp | 1 + 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/DataStructures/StaticRTree.h b/DataStructures/StaticRTree.h index 542fe8e9a..5889b1ed9 100644 --- a/DataStructures/StaticRTree.h +++ b/DataStructures/StaticRTree.h @@ -45,13 +45,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include + #include #include #include #include #include +#include #include #include #include @@ -265,7 +266,7 @@ class StaticRTree typename ShM::vector m_search_tree; uint64_t m_element_count; const std::string m_leaf_node_filename; - boost::shared_ptr m_coordinate_list; + std::shared_ptr m_coordinate_list; public: StaticRTree() = delete; @@ -422,7 +423,7 @@ class StaticRTree // Read-only operation for queries explicit StaticRTree(const boost::filesystem::path &node_file, const boost::filesystem::path &leaf_file, - const boost::shared_ptr coordinate_list) + const std::shared_ptr coordinate_list) : m_leaf_node_filename(leaf_file.string()) { // open tree node file and load into RAM. @@ -465,7 +466,7 @@ class StaticRTree explicit StaticRTree(TreeNode *tree_node_ptr, const uint32_t number_of_nodes, const boost::filesystem::path &leaf_file, - boost::shared_ptr coordinate_list) + std::shared_ptr coordinate_list) : m_search_tree(tree_node_ptr, number_of_nodes), m_leaf_node_filename(leaf_file.string()), m_coordinate_list(coordinate_list) { diff --git a/Server/DataStructures/InternalDataFacade.h b/Server/DataStructures/InternalDataFacade.h index 5f26506d8..45175808e 100644 --- a/Server/DataStructures/InternalDataFacade.h +++ b/Server/DataStructures/InternalDataFacade.h @@ -45,9 +45,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -#include -#include - template class InternalDataFacade : public BaseDataFacade { @@ -64,7 +61,7 @@ template class InternalDataFacade : public BaseDataFacade::vector> m_coordinate_list; + std::shared_ptr::vector> m_coordinate_list; ShM::vector m_via_node_list; ShM::vector m_name_ID_list; ShM::vector m_turn_instruction_list; @@ -74,7 +71,7 @@ template class InternalDataFacade : public BaseDataFacade::vector m_geometry_indices; ShM::vector m_geometry_list; - boost::shared_ptr::vector, false>> + std::shared_ptr::vector, false>> m_static_rtree; void LoadTimestamp(const boost::filesystem::path ×tamp_path) @@ -129,7 +126,7 @@ template class InternalDataFacade : public BaseDataFacade>(number_of_coordinates); + std::make_shared>(number_of_coordinates); for (unsigned i = 0; i < number_of_coordinates; ++i) { nodes_input_stream.read((char *)¤t_node, sizeof(NodeInfo)); @@ -193,7 +190,7 @@ template class InternalDataFacade : public BaseDataFacadeempty(), "coordinates must be loaded before r-tree"); - m_static_rtree = boost::make_shared>( + m_static_rtree = std::make_shared>( ram_index_path, file_index_path, m_coordinate_list); } diff --git a/Server/DataStructures/SharedDataFacade.h b/Server/DataStructures/SharedDataFacade.h index 09c4f8525..aa26a2503 100644 --- a/Server/DataStructures/SharedDataFacade.h +++ b/Server/DataStructures/SharedDataFacade.h @@ -39,10 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../../Util/ProgramOptions.h" #include "../../Util/SimpleLogger.h" -#include -#include - #include +#include template class SharedDataFacade : public BaseDataFacade { @@ -68,12 +66,12 @@ template class SharedDataFacade : public BaseDataFacade m_query_graph; - boost::shared_ptr m_layout_memory; - boost::shared_ptr m_large_memory; + std::shared_ptr m_query_graph; + std::shared_ptr m_layout_memory; + std::shared_ptr m_large_memory; std::string m_timestamp; - boost::shared_ptr::vector> m_coordinate_list; + std::shared_ptr::vector> m_coordinate_list; ShM::vector m_via_node_list; ShM::vector m_name_ID_list; ShM::vector m_turn_instruction_list; @@ -83,7 +81,7 @@ template class SharedDataFacade : public BaseDataFacade::vector m_geometry_indices; ShM::vector m_geometry_list; - boost::shared_ptr::vector, true>> + std::shared_ptr::vector, true>> m_static_rtree; void LoadTimestamp() @@ -99,7 +97,7 @@ template class SharedDataFacade : public BaseDataFacadeempty(), "coordinates must be loaded before r-tree"); RTreeNode *tree_ptr = (RTreeNode *)(shared_memory + data_layout->GetRSearchTreeOffset()); - m_static_rtree = boost::make_shared< + m_static_rtree = std::make_shared< StaticRTree::vector, true>>( tree_ptr, data_layout->r_search_tree_size, file_index_path, m_coordinate_list); } @@ -125,7 +123,7 @@ template class SharedDataFacade : public BaseDataFacadeGetCoordinateListOffset()); - m_coordinate_list = boost::make_shared::vector>( + m_coordinate_list = std::make_shared::vector>( coordinate_list_ptr, data_layout->coordinate_list_size); TurnInstruction *turn_instruction_list_ptr = diff --git a/prepare.cpp b/prepare.cpp index 66e58dd07..f4dc1889d 100644 --- a/prepare.cpp +++ b/prepare.cpp @@ -50,6 +50,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include #include #include