MapViewer/lib/osmparser/include/osmimember.hpp

51 lines
949 B
C++
Raw Normal View History

2021-04-16 13:16:00 +00:00
#pragma once
#include <string>
#include <vector>
#include <map>
#include <util.hpp>
#include <osmtag.hpp>
namespace osmp
{
class Object;
class IMember
{
public:
enum class Type {
NODE, WAY, RELATION
};
public:
IMember(const IMember& other) = delete;
virtual ~IMember() {}
2021-04-18 13:44:48 +00:00
[[nodiscard]] IMember::Type GetType() const;
2021-04-16 13:16:00 +00:00
2021-04-18 13:44:48 +00:00
[[nodiscard]] const std::vector<Tag>& GetTags() const;
[[nodiscard]] size_t GetTagsSize() const;
[[nodiscard]] const Tag& GetTag(size_t index) const;
[[nodiscard]] std::string GetTag(const std::string& key) const;
2021-04-16 13:16:00 +00:00
protected:
IMember(const tinyxml2::XMLElement* element, Object* parent, IMember::Type type);
protected:
IMember::Type type;
Object* parent;
std::vector<Tag> tags;
// std::map<std::string, std::string> tags;
public:
2021-04-17 01:15:07 +00:00
uint64_t id;
2021-04-16 13:16:00 +00:00
std::string user;
unsigned int uid;
bool visible;
std::string version;
unsigned int changeset;
std::string timestamp;
};
}