alaCarte Maps
Renderer for OpenStreetMap tiles
relation.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef RELATION_HPP
23 #define RELATION_HPP
24 
25 
26 #include "settings.hpp"
27 #include "general/geo_object.hpp"
28 #include <boost/archive/text_oarchive.hpp>
29 #include <boost/archive/text_iarchive.hpp>
30 #include <boost/serialization/vector.hpp>
31 class Relation : public GeoObject
32 {
33 private:
35 public:
36  Relation() = default;
37  Relation(const Relation& other) = default;
38  Relation(Relation&& other) = default;
39  Relation( const std::vector<NodeId>& nodeIDs,
41  const std::vector<WayId>& wayIDs,
44  virtual ~Relation() = default;
45 
46  TESTABLE const std::vector<WayId>& getWayIDs() const;
47  TESTABLE const std::vector<NodeId>& getNodeIDs() const;
48  TESTABLE const CachedString& getWayRole(WayId id) const;
49  TESTABLE const CachedString& getNodeRole(NodeId id) const;
50 private:
51  template<typename Archive>
52  void serialize(Archive &ar, const unsigned int version){
53  GeoObject::serialize(ar, version);
54  ar & nodeIDs;
55  ar & wayIDs;
56  ar & nodeRoles;
57  ar & wayRoles;
58  }
59 
60 private:
61  std::vector<NodeId> nodeIDs;
62  std::vector<WayId> wayIDs;
65 };
66 
67 
68 
69 
70 #endif
std::vector< NodeId > nodeIDs
Definition: relation.hpp:61
void serialize(Archive &ar, const unsigned int version)
Definition: relation.hpp:52
std::vector< WayId > wayIDs
Definition: relation.hpp:62
TESTABLE const std::vector< NodeId > & getNodeIDs() const
Definition: relation.cpp:44
DataMap< WayId, CachedString > wayRoles
Definition: relation.hpp:64
TESTABLE const std::vector< WayId > & getWayIDs() const
Definition: relation.cpp:39
void serialize(Archive &ar, const unsigned int version)
Definition: geo_object.hpp:49
DataMap< NodeId, CachedString > nodeRoles
Definition: relation.hpp:63
virtual ~Relation()=default
TESTABLE const CachedString & getWayRole(WayId id) const
Definition: relation.cpp:49
DataMap< CachedString, CachedString > tags
Definition: geo_object.hpp:53
friend class boost::serialization::access
Definition: relation.hpp:34
Represents a string which is cached into an internal cache.
TESTABLE const CachedString & getNodeRole(NodeId id) const
Definition: relation.cpp:55
#define TESTABLE
Definition: settings.hpp:85
Relation()=default