diff --git a/include/engine/datafacade/shared_datafacade.hpp b/include/engine/datafacade/shared_datafacade.hpp index bbb2accb0..64ee0ae21 100644 --- a/include/engine/datafacade/shared_datafacade.hpp +++ b/include/engine/datafacade/shared_datafacade.hpp @@ -86,7 +86,7 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadTimestamp() { - char *timestamp_ptr = + auto timestamp_ptr = data_layout->GetBlockPtr(shared_memory, storage::SharedDataLayout::TIMESTAMP); m_timestamp.resize(data_layout->GetBlockSize(storage::SharedDataLayout::TIMESTAMP)); std::copy(timestamp_ptr, @@ -98,7 +98,7 @@ template class SharedDataFacade final : public BaseDataFacade< { BOOST_ASSERT_MSG(!m_coordinate_list->empty(), "coordinates must be loaded before r-tree"); - RTreeNode *tree_ptr = data_layout->GetBlockPtr( + auto tree_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::R_SEARCH_TREE); m_static_rtree.reset(new TimeStampedRTreePair( CURRENT_TIMESTAMP, @@ -111,10 +111,10 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadGraph() { - GraphNode *graph_nodes_ptr = data_layout->GetBlockPtr( + auto graph_nodes_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::GRAPH_NODE_LIST); - GraphEdge *graph_edges_ptr = data_layout->GetBlockPtr( + auto graph_edges_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::GRAPH_EDGE_LIST); typename util::ShM::vector node_list( @@ -127,21 +127,21 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadNodeAndEdgeInformation() { - util::FixedPointCoordinate *coordinate_list_ptr = + auto coordinate_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::COORDINATE_LIST); m_coordinate_list = util::make_unique::vector>( coordinate_list_ptr, data_layout->num_entries[storage::SharedDataLayout::COORDINATE_LIST]); - extractor::TravelMode *travel_mode_list_ptr = + auto travel_mode_list_ptr = data_layout->GetBlockPtr(shared_memory, storage::SharedDataLayout::TRAVEL_MODE); typename util::ShM::vector travel_mode_list( travel_mode_list_ptr, data_layout->num_entries[storage::SharedDataLayout::TRAVEL_MODE]); m_travel_mode_list.swap(travel_mode_list); - extractor::TurnInstruction *turn_instruction_list_ptr = + auto turn_instruction_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::TURN_INSTRUCTION); typename util::ShM::vector turn_instruction_list( @@ -149,7 +149,7 @@ template class SharedDataFacade final : public BaseDataFacade< data_layout->num_entries[storage::SharedDataLayout::TURN_INSTRUCTION]); m_turn_instruction_list.swap(turn_instruction_list); - unsigned *name_id_list_ptr = data_layout->GetBlockPtr( + auto name_id_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::NAME_ID_LIST); typename util::ShM::vector name_id_list( name_id_list_ptr, data_layout->num_entries[storage::SharedDataLayout::NAME_ID_LIST]); @@ -158,7 +158,7 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadViaNodeList() { - NodeID *via_node_list_ptr = data_layout->GetBlockPtr( + auto via_node_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::VIA_NODE_LIST); typename util::ShM::vector via_node_list( via_node_list_ptr, data_layout->num_entries[storage::SharedDataLayout::VIA_NODE_LIST]); @@ -167,16 +167,16 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadNames() { - unsigned *offsets_ptr = data_layout->GetBlockPtr( + auto offsets_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::NAME_OFFSETS); - NameIndexBlock *blocks_ptr = data_layout->GetBlockPtr( + auto blocks_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::NAME_BLOCKS); typename util::ShM::vector name_offsets( offsets_ptr, data_layout->num_entries[storage::SharedDataLayout::NAME_OFFSETS]); typename util::ShM::vector name_blocks( blocks_ptr, data_layout->num_entries[storage::SharedDataLayout::NAME_BLOCKS]); - char *names_list_ptr = data_layout->GetBlockPtr( + auto names_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::NAME_CHAR_LIST); typename util::ShM::vector names_char_list( names_list_ptr, data_layout->num_entries[storage::SharedDataLayout::NAME_CHAR_LIST]); @@ -193,7 +193,7 @@ template class SharedDataFacade final : public BaseDataFacade< return; } - unsigned *core_marker_ptr = data_layout->GetBlockPtr( + auto core_marker_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::CORE_MARKER); typename util::ShM::vector is_core_node( core_marker_ptr, data_layout->num_entries[storage::SharedDataLayout::CORE_MARKER]); @@ -202,21 +202,21 @@ template class SharedDataFacade final : public BaseDataFacade< void LoadGeometries() { - unsigned *geometries_compressed_ptr = data_layout->GetBlockPtr( + auto geometries_compressed_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::GEOMETRIES_INDICATORS); typename util::ShM::vector edge_is_compressed( geometries_compressed_ptr, data_layout->num_entries[storage::SharedDataLayout::GEOMETRIES_INDICATORS]); m_edge_is_compressed.swap(edge_is_compressed); - unsigned *geometries_index_ptr = data_layout->GetBlockPtr( + auto geometries_index_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::GEOMETRIES_INDEX); typename util::ShM::vector geometry_begin_indices( geometries_index_ptr, data_layout->num_entries[storage::SharedDataLayout::GEOMETRIES_INDEX]); m_geometry_indices.swap(geometry_begin_indices); - unsigned *geometries_list_ptr = data_layout->GetBlockPtr( + auto geometries_list_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::GEOMETRIES_LIST); typename util::ShM::vector geometry_list( geometries_list_ptr, @@ -238,7 +238,8 @@ template class SharedDataFacade final : public BaseDataFacade< } data_timestamp_ptr = static_cast( storage::makeSharedMemory(storage::CURRENT_REGIONS, - sizeof(storage::SharedDataTimestamp), false, false)->Ptr()); + sizeof(storage::SharedDataTimestamp), false, false) + ->Ptr()); CURRENT_LAYOUT = storage::LAYOUT_NONE; CURRENT_DATA = storage::DATA_NONE; CURRENT_TIMESTAMP = 0; @@ -289,7 +290,7 @@ template class SharedDataFacade final : public BaseDataFacade< m_large_memory.reset(storage::makeSharedMemory(CURRENT_DATA)); shared_memory = (char *)(m_large_memory->Ptr()); - const char *file_index_ptr = data_layout->GetBlockPtr( + const auto file_index_ptr = data_layout->GetBlockPtr( shared_memory, storage::SharedDataLayout::FILE_INDEX_PATH); file_index_path = boost::filesystem::path(file_index_ptr); if (!boost::filesystem::exists(file_index_path)) @@ -309,8 +310,8 @@ template class SharedDataFacade final : public BaseDataFacade< LoadNames(); LoadCoreInformation(); - util::SimpleLogger().Write() - << "number of geometries: " << m_coordinate_list->size(); + util::SimpleLogger().Write() << "number of geometries: " + << m_coordinate_list->size(); for (unsigned i = 0; i < m_coordinate_list->size(); ++i) { if (!GetCoordinateOfNode(i).IsValid())