Review fixes
This commit is contained in:
committed by
Michael Krasnyk
parent
84cb7865ab
commit
ff3b398e23
@@ -11,9 +11,17 @@ namespace util
|
||||
class OsmIDTyped
|
||||
{
|
||||
public:
|
||||
enum class Type : uint8_t
|
||||
{
|
||||
Unknown = 0,
|
||||
Node,
|
||||
Way,
|
||||
Relation
|
||||
};
|
||||
|
||||
using HashType = std::uint64_t;
|
||||
|
||||
OsmIDTyped(std::uint64_t id_, std::uint8_t type_) : id(id_), type(type_)
|
||||
OsmIDTyped(std::uint64_t id_, Type type_) : id(id_), type(type_)
|
||||
{
|
||||
// check if type value not above type size bound
|
||||
BOOST_ASSERT(id_ < (std::uint64_t(1) << 56));
|
||||
@@ -25,11 +33,11 @@ class OsmIDTyped
|
||||
inline HashType Hash() const { return (std::uint64_t(id) | std::uint64_t(type) << 56); }
|
||||
|
||||
std::uint64_t GetID() const { return id; }
|
||||
std::uint8_t GetType() const { return type; }
|
||||
Type GetType() const { return type; }
|
||||
|
||||
private:
|
||||
std::uint64_t id : 56;
|
||||
std::uint8_t type;
|
||||
Type type;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
|
||||
Reference in New Issue
Block a user