alaCarte Maps
Renderer for OpenStreetMap tiles
way.hpp
Go to the documentation of this file.
1 
21 #pragma once
22 #ifndef WAY_HPP
23 #define WAY_HPP
24 
25 #include "settings.hpp"
26 
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 Way : public GeoObject
32 {
33 private:
35 public:
36  Way() = default;
37  Way(const Way& other) = default;
38  Way(Way&& other) = default;
39  Way(const std::vector<NodeId>& nodeIDs, const DataMap<CachedString, CachedString>& tags)
40  : GeoObject(tags)
41  , nodeIDs(nodeIDs)
42  { }
43  virtual ~Way() = default;
44 
45  inline const std::vector<NodeId>& getNodeIDs() const { return nodeIDs; }
46  inline bool isClosed() const { return (nodeIDs.front() == nodeIDs.back()); }
47 
48 private:
49  template<typename Archive>
50  void serialize(Archive &ar, const unsigned int version){
51  GeoObject::serialize(ar, version);
52  ar & nodeIDs;
53  }
54 
55 private:
56  std::vector<NodeId> nodeIDs;
57 };
58 
59 #endif
bool isClosed() const
Definition: way.hpp:46
void serialize(Archive &ar, const unsigned int version)
Definition: geo_object.hpp:49
void serialize(Archive &ar, const unsigned int version)
Definition: way.hpp:50
friend class boost::serialization::access
Definition: way.hpp:34
Way()=default
virtual ~Way()=default
DataMap< CachedString, CachedString > tags
Definition: geo_object.hpp:53
Way(const std::vector< NodeId > &nodeIDs, const DataMap< CachedString, CachedString > &tags)
Definition: way.hpp:39
std::vector< NodeId > nodeIDs
Definition: way.hpp:56
Definition: way.hpp:31
const std::vector< NodeId > & getNodeIDs() const
Definition: way.hpp:45