Added nodiscard
This commit is contained in:
parent
d8c11c48c9
commit
87046f5d18
6 changed files with 99 additions and 260 deletions
|
@ -22,12 +22,12 @@ namespace osmp
|
|||
IMember(const IMember& other) = delete;
|
||||
virtual ~IMember() {}
|
||||
|
||||
IMember::Type GetType() const;
|
||||
[[nodiscard]] IMember::Type GetType() const;
|
||||
|
||||
const std::vector<Tag>& GetTags() const;
|
||||
size_t GetTagsSize() const;
|
||||
const Tag& GetTag(size_t index) const;
|
||||
std::string GetTag(const std::string& key) const;
|
||||
[[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;
|
||||
|
||||
protected:
|
||||
IMember(const tinyxml2::XMLElement* element, Object* parent, IMember::Type type);
|
||||
|
|
|
@ -15,20 +15,20 @@ namespace osmp
|
|||
class Object
|
||||
{
|
||||
public:
|
||||
Object(const std::string& file);
|
||||
explicit Object(const std::string& file);
|
||||
~Object();
|
||||
|
||||
std::vector<std::shared_ptr<Node>> GetNodes() const;
|
||||
size_t GetNodesSize() const;
|
||||
std::shared_ptr<Node> GetNode(uint64_t id) const;
|
||||
[[nodiscard]] std::vector<std::shared_ptr<Node>> GetNodes() const;
|
||||
[[nodiscard]] size_t GetNodesSize() const;
|
||||
[[nodiscard]] std::shared_ptr<Node> GetNode(uint64_t id) const;
|
||||
|
||||
std::vector<std::shared_ptr<Way>> GetWays() const;
|
||||
size_t GetWaysSize() const;
|
||||
std::shared_ptr<Way> GetWay(uint64_t id) const;
|
||||
[[nodiscard]] std::vector<std::shared_ptr<Way>> GetWays() const;
|
||||
[[nodiscard]] size_t GetWaysSize() const;
|
||||
[[nodiscard]] std::shared_ptr<Way> GetWay(uint64_t id) const;
|
||||
|
||||
std::vector<std::shared_ptr<Relation>> GetRelations() const;
|
||||
size_t GetRelationsSize() const;
|
||||
std::shared_ptr<Relation> GetRelation(uint64_t id) const;
|
||||
[[nodiscard]] std::vector<std::shared_ptr<Relation>> GetRelations() const;
|
||||
[[nodiscard]] size_t GetRelationsSize() const;
|
||||
[[nodiscard]] std::shared_ptr<Relation> GetRelation(uint64_t id) const;
|
||||
|
||||
public:
|
||||
const std::string version;
|
||||
|
|
|
@ -21,17 +21,17 @@ namespace osmp
|
|||
public:
|
||||
Relation(const tinyxml2::XMLElement* xml, Object* parent);
|
||||
|
||||
std::string GetRelationType();
|
||||
[[nodiscard]] std::string GetRelationType();
|
||||
|
||||
const std::vector<Member>& GetNodes() const;
|
||||
size_t GetNodesSize() const;
|
||||
const Member& GetNode(size_t index) const;
|
||||
[[nodiscard]] const std::vector<Member>& GetNodes() const;
|
||||
[[nodiscard]] size_t GetNodesSize() const;
|
||||
[[nodiscard]] const Member& GetNode(size_t index) const;
|
||||
|
||||
const std::vector<Member>& GetWays() const;
|
||||
size_t GetWaysSize() const;
|
||||
const Member& GetWay(size_t index) const;
|
||||
[[nodiscard]] const std::vector<Member>& GetWays() const;
|
||||
[[nodiscard]] size_t GetWaysSize() const;
|
||||
[[nodiscard]] const Member& GetWay(size_t index) const;
|
||||
|
||||
bool HasNullMembers() const { return hasNullMembers; }
|
||||
[[nodiscard]] bool HasNullMembers() const { return hasNullMembers; }
|
||||
|
||||
private:
|
||||
std::string relationType;
|
||||
|
|
|
@ -16,9 +16,9 @@ namespace osmp
|
|||
public:
|
||||
Way(const tinyxml2::XMLElement* way_elem, Object* parent);
|
||||
|
||||
const std::vector<std::shared_ptr<Node>>& GetNodes() const;
|
||||
size_t GetNodesSize() const;
|
||||
const std::shared_ptr<Node>& GetNode(size_t index) const;
|
||||
[[nodiscard]] const std::vector<std::shared_ptr<Node>>& GetNodes() const;
|
||||
[[nodiscard]] size_t GetNodesSize() const;
|
||||
[[nodiscard]] const std::shared_ptr<Node>& GetNode(size_t index) const;
|
||||
|
||||
public:
|
||||
bool area, closed; // Closed := Startpoint = endpoint, Area := Closed AND certain conditions are not met
|
||||
|
|
|
@ -14,8 +14,8 @@ namespace osmp
|
|||
double minlat, minlon, maxlat, maxlon;
|
||||
} Bounds;
|
||||
|
||||
std::string GetSafeAttributeString(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
double GetSafeAttributeFloat(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
uint64_t GetSafeAttributeUint64(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
bool GetSafeAttributeBool(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
[[nodiscard]] std::string GetSafeAttributeString(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
[[nodiscard]] double GetSafeAttributeFloat(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
[[nodiscard]] uint64_t GetSafeAttributeUint64(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
[[nodiscard]] bool GetSafeAttributeBool(const tinyxml2::XMLElement* elem, const std::string& name);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue