replacing all boost unordereds

This commit is contained in:
Dennis Luxen 2014-05-09 18:40:07 +02:00
parent 00e27e4b5c
commit 5e26e4c22d
9 changed files with 43 additions and 44 deletions

View File

@ -1,23 +1,21 @@
#ifndef __BFS_COMPONENT_EXPLORER_H__
#define __BFS_COMPONENT_EXPLORER_H__
#include <queue>
#include <boost/unordered_set.hpp>
#include "../typedefs.h"
#include "../DataStructures/DynamicGraph.h"
#include "../DataStructures/RestrictionMap.h"
/**
* Explores the components of the given graph while respecting turn restrictions
* and barriers.
*/
#include <queue>
#include <unordered_set>
// Explores the components of the given graph while respecting turn restrictions
// and barriers.
template <typename GraphT> class BFSComponentExplorer
{
public:
BFSComponentExplorer(const GraphT &dynamicGraph,
const RestrictionMap &restrictions,
const boost::unordered_set<NodeID> &barrier_nodes)
const std::unordered_set<NodeID> &barrier_nodes)
: m_graph(dynamicGraph), m_restriction_map(restrictions), m_barrier_nodes(barrier_nodes)
{
BOOST_ASSERT(m_graph.GetNumberOfNodes() > 0);
@ -136,7 +134,7 @@ template <typename GraphT> class BFSComponentExplorer
const GraphT &m_graph;
const RestrictionMap &m_restriction_map;
const boost::unordered_set<NodeID> &m_barrier_nodes;
const std::unordered_set<NodeID> &m_barrier_nodes;
};
#endif

View File

@ -42,14 +42,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../DataStructures/RestrictionMap.h"
#include "GeometryCompressor.h"
#include <boost/unordered_map.hpp>
#include <boost/unordered_set.hpp>
#include <algorithm>
#include <iosfwd>
#include <memory>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
struct lua_State;
@ -105,8 +104,8 @@ class EdgeBasedGraphFactory
DeallocatingVector<EdgeBasedEdge> m_edge_based_edge_list;
std::shared_ptr<NodeBasedDynamicGraph> m_node_based_graph;
boost::unordered_set<NodeID> m_barrier_nodes;
boost::unordered_set<NodeID> m_traffic_lights;
std::unordered_set<NodeID> m_barrier_nodes;
std::unordered_set<NodeID> m_traffic_lights;
std::unique_ptr<RestrictionMap> m_restriction_map;

View File

@ -27,7 +27,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../typedefs.h"
#include <boost/unordered_map.hpp>
#include <unordered_map>
#include <vector>
@ -58,7 +58,7 @@ class GeometryCompressor
void IncreaseFreeList();
std::vector<std::vector<CompressedNode>> m_compressed_geometries;
std::vector<unsigned> m_free_list;
boost::unordered_map<EdgeID, unsigned> m_edge_id_to_list_index_map;
std::unordered_map<EdgeID, unsigned> m_edge_id_to_list_index_map;
};
#endif // GEOMETRY_COMPRESSOR_H

View File

@ -28,28 +28,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef HASH_TABLE_H
#define HASH_TABLE_H
#include <boost/functional/hash.hpp>
#include <boost/ref.hpp>
#include <boost/unordered_map.hpp>
template<typename Key, typename Value, typename Hash = boost::hash<Key> >
class HashTable : public boost::unordered_map<Key, Value> {
#include <unordered_map>
template <typename Key, typename Value> class HashTable : public std::unordered_map<Key, Value>
{
private:
typedef boost::unordered_map<Key, Value, Hash> super;
typedef std::unordered_map<Key, Value> super;
public:
static Value default_value;
constexpr static Value default_value();
HashTable() : super() {}
explicit HashTable(const unsigned size) : super(size) {}
inline void Add( Key const & key, Value const & value) {
super::emplace(std::make_pair(key, value));
}
inline void Add(Key const &key, Value const &value) { super::emplace(key, value); }
inline const Value Find(Key const &key) const
{
typename super::const_iterator iter = super::find(key);
auto iter = super::find(key);
if (iter == super::end())
{
return boost::cref(default_value);
@ -67,7 +66,7 @@ public:
}
};
template<typename Key, typename Value, typename Hash>
Value HashTable<Key, Value, Hash>::default_value;
// template<typename Key, typename Value, typename Hash>
// Value HashTable<Key, Value, Hash>::default_value;
#endif /* HASH_TABLE_H */

View File

@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <vector>
ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers &extraction_containers,
boost::unordered_map<std::string, NodeID> &string_map)
std::unordered_map<std::string, NodeID> &string_map)
: string_map(string_map), external_memory(extraction_containers)
{
}

View File

@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../typedefs.h"
#include <boost/unordered_map.hpp>
#include <unordered_map>
#include <string>
struct ExternalMemoryNode;
@ -41,14 +41,14 @@ struct InputRestrictionContainer;
class ExtractorCallbacks
{
private:
boost::unordered_map<std::string, NodeID> &string_map;
std::unordered_map<std::string, NodeID> &string_map;
ExtractionContainers &external_memory;
public:
ExtractorCallbacks() = delete;
ExtractorCallbacks(const ExtractorCallbacks &) = delete;
explicit ExtractorCallbacks(ExtractionContainers &extraction_containers,
boost::unordered_map<std::string, NodeID> &string_map);
std::unordered_map<std::string, NodeID> &string_map);
// warning: caller needs to take care of synchronization!
void ProcessNode(const ExternalMemoryNode &node);

View File

@ -29,10 +29,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SERVER_PATH_H
#include <boost/filesystem.hpp>
#include <boost/unordered_map.hpp>
#include <unordered_map>
#include <string>
typedef boost::unordered_map<const std::string, boost::filesystem::path> ServerPaths;
typedef std::unordered_map<std::string, boost::filesystem::path> ServerPaths;
#endif // SERVER_PATH_H

View File

@ -36,13 +36,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../Plugins/BasePlugin.h"
#include "../Util/ProgramOptions.h"
#include <unordered_map>
#include <string>
struct SharedBarriers;
template <class EdgeDataT> class BaseDataFacade;
class OSRM_impl
{
private:
typedef boost::unordered_map<std::string, BasePlugin *> PluginMap;
typedef std::unordered_map<std::string, BasePlugin *> PluginMap;
public:
OSRM_impl(const ServerPaths &paths, const bool use_shared_memory);

View File

@ -42,12 +42,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cstdlib>
#include <boost/unordered_map.hpp>
#include <chrono>
#include <iostream>
#include <fstream>
#include <string>
#include <unordered_map>
ExtractorCallbacks *extractor_callbacks;
UUID uuid;
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
restriction_fileName.replace(pos, 8, ".osrm.restrictions");
}
boost::unordered_map<std::string, NodeID> string_map;
std::unordered_map<std::string, NodeID> string_map;
ExtractionContainers extraction_containers;
string_map[""] = 0;