Add ExtractionRelation class

This commit is contained in:
Denis Koronchik
2017-08-24 16:03:42 +03:00
committed by Michael Krasnyk
parent a5776288f6
commit a253111cbe
2 changed files with 100 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
#ifndef EXTRACTION_RELATION_HPP
#define EXTRACTION_RELATION_HPP
#include "util/osm_id_typed.hpp"
#include <string>
#include <unordered_map>
namespace osrm
{
namespace extractor
{
namespace detail
{
inline const char * checkedString(const char * str)
{
return str ? str : "";
}
} // namespace detail
struct ExtractionRelation
{
using AttributesMap = std::unordered_map<std::string, std::string>;
ExtractionRelation()
: is_restriction(false)
{
}
void clear()
{
is_restriction = false;
values.clear();
}
bool IsRestriction() const
{
return is_restriction;
}
AttributesMap & GetMember(util::OsmIDTyped id)
{
return values[id.Hash()];
}
// AttributesMap & operator[] (util::OsmIDTyped id)
// {
// return values[id];
// }
bool is_restriction;
std::unordered_map<util::OsmIDTyped::HashType, AttributesMap> values;
};
} // namespace extractor
} // namespace osrm
#endif // EXTRACTION_RELATION_HPP