MapViewer/lib/osmparser/include/osmobject.hpp

44 lines
1 KiB
C++
Raw Normal View History

2021-04-14 19:04:08 +00:00
#pragma once
#include <string>
2021-04-16 13:16:00 +00:00
#include <memory>
2021-04-14 19:04:08 +00:00
#include <map>
#include <vector>
#include <util.hpp>
namespace osmp
{
class Node;
class Way;
2021-04-16 13:16:00 +00:00
class Relation;
2021-04-14 19:04:08 +00:00
class Object
{
public:
2021-04-18 13:44:48 +00:00
explicit Object(const std::string& file);
2021-04-14 19:04:08 +00:00
~Object();
2021-04-18 13:44:48 +00:00
[[nodiscard]] std::vector<std::shared_ptr<Node>> GetNodes() const;
[[nodiscard]] size_t GetNodesSize() const;
[[nodiscard]] std::shared_ptr<Node> GetNode(uint64_t id) const;
2021-04-14 19:04:08 +00:00
2021-04-18 13:44:48 +00:00
[[nodiscard]] std::vector<std::shared_ptr<Way>> GetWays() const;
[[nodiscard]] size_t GetWaysSize() const;
[[nodiscard]] std::shared_ptr<Way> GetWay(uint64_t id) const;
2021-04-16 13:16:00 +00:00
2021-04-18 13:44:48 +00:00
[[nodiscard]] std::vector<std::shared_ptr<Relation>> GetRelations() const;
[[nodiscard]] size_t GetRelationsSize() const;
[[nodiscard]] std::shared_ptr<Relation> GetRelation(uint64_t id) const;
2021-04-14 19:04:08 +00:00
public:
const std::string version;
const std::string generator;
Bounds bounds;
private:
2021-04-17 01:15:07 +00:00
std::map<uint64_t, std::shared_ptr<Node>> nodes;
std::map<uint64_t, std::shared_ptr<Way>> ways;
std::map<uint64_t, std::shared_ptr<Relation>> relations;
2021-04-14 19:04:08 +00:00
};
}