osrm-backend/include/updater/updater.hpp
Xun(Perry) Liu 85a8cc645f Feature/profile customize cell (#62)
* feat: Add unit test for two level customization
issues: #49

* feat: Add class for statistic set and related unit test
issue: #49

* Initial commit of cell_update_record with unit tests.

* feat: Initial commit of cell_update_record with unit tests.
issue: #49

* Refactor code.

* Refactor code.
issue: #49

* Integrate logic with customization
issue: #49

* fix: adjust comments
issue: #49

* feat: add flag of incremental, will load previous metrix table if set to true
issues: #49

* fix: compilation in docker.
issues: #49

* fix: fix crash issue and add protection code
issues: #49

* Fix: Update code based on pull request's comments
issue: #49

* fix: Remove util/concurrent_set, directly define set in updater.hpp
issue: #49

* fix: Passing shared_ptr by reference.
2019-10-11 17:38:11 +08:00

52 lines
1.7 KiB
C++

#ifndef OSRM_UPDATER_UPDATER_HPP
#define OSRM_UPDATER_UPDATER_HPP
#include "updater/updater_config.hpp"
#include "extractor/edge_based_edge.hpp"
#include "tbb/concurrent_unordered_set.h"
#include <chrono>
#include <vector>
namespace osrm
{
namespace updater
{
// https://www.threadingbuildingblocks.org/docs/help/reference/containers_overview/concurrent_unordered_set_cls.html
using NodeSet = tbb::concurrent_unordered_set<NodeID>;
using NodeSetPtr = std::shared_ptr<NodeSet>;
using NodeSetViewerPtr = std::shared_ptr<const NodeSet>;
class Updater
{
public:
Updater(UpdaterConfig config_) : config(std::move(config_)) {}
EdgeID
LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
std::vector<EdgeWeight> &node_weights,
std::uint32_t &connectivity_checksum,
NodeSetPtr node_updated) const;
EdgeID LoadAndUpdateEdgeExpandedGraph(
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
std::vector<EdgeWeight> &node_weights,
std::vector<EdgeDuration> &node_durations, // TODO: remove when optional
std::uint32_t &connectivity_checksum,
NodeSetPtr node_updated) const;
EdgeID LoadAndUpdateEdgeExpandedGraph(
std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
std::vector<EdgeWeight> &node_weights,
std::vector<EdgeDuration> &node_durations, // TODO: remove when optional
std::vector<EdgeDistance> &node_distances, // TODO: remove when optional
std::uint32_t &connectivity_checksum,
NodeSetPtr node_updated) const;
private:
UpdaterConfig config;
};
}
}
#endif