StaticGraph(typename ShM<NodeArrayEntry, UseSharedMemory>::vector &nodes, typename ShM<EdgeArrayEntry, UseSharedMemory>::vector &edges) { number_of_nodes = static_cast<decltype(number_of_nodes)>(nodes.size() - 1); number_of_edges = static_cast<decltype(number_of_edges)>(edges.size()); node_array.swap(nodes); edge_array.swap(edges); }
void LoadNames() { unsigned *offsets_ptr = data_layout->GetBlockPtr<unsigned>(shared_memory, SharedDataLayout::NAME_OFFSETS); NameIndexBlock *blocks_ptr = data_layout->GetBlockPtr<NameIndexBlock>(shared_memory, SharedDataLayout::NAME_BLOCKS); typename ShM<unsigned, true>::vector name_offsets( offsets_ptr, data_layout->num_entries[SharedDataLayout::NAME_OFFSETS]); typename ShM<NameIndexBlock, true>::vector name_blocks( blocks_ptr, data_layout->num_entries[SharedDataLayout::NAME_BLOCKS]); char *names_list_ptr = data_layout->GetBlockPtr<char>(shared_memory, SharedDataLayout::NAME_CHAR_LIST); typename ShM<char, true>::vector names_char_list( names_list_ptr, data_layout->num_entries[SharedDataLayout::NAME_CHAR_LIST]); m_name_table = osrm::make_unique<RangeTable<16, true>>( name_offsets, name_blocks, static_cast<unsigned>(names_char_list.size())); m_names_char_list.swap(names_char_list); }