ad_map_access
Store.hpp
Go to the documentation of this file.
1 // ----------------- BEGIN LICENSE BLOCK ---------------------------------
2 //
3 // Copyright (C) 2018-2021 Intel Corporation
4 //
5 // SPDX-License-Identifier: MIT
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <map>
15 #include <memory>
16 
17 #include "ad/map/access/Types.hpp"
19 #include "ad/map/lane/Types.hpp"
21 
23 namespace ad {
25 namespace map {
26 
28 namespace match {
29 class AdMapMatching;
30 }
31 
33 namespace access {
34 
35 class GeometryStore;
36 
40 class Store
41 {
42  friend class Factory;
43  friend class match::AdMapMatching;
44 
45 public: // Derived types
46  typedef std::shared_ptr<Store> Ptr;
47 
52  Store();
53 
57  Store(Store const &other) = delete;
58 
62  Store(Store &&other) = delete;
63 
67  Store &operator=(Store const &other) = delete;
68 
72  Store &operator=(Store &&other) = delete;
73 
78  virtual ~Store();
79 
80 public: // Main Operations
89  bool save(serialize::ISerializer &serializer,
90  bool use_magic = true,
91  bool use_embedded_geometry = true,
92  bool use_geometry_store = false);
93 
99  bool load(serialize::ISerializer &serializer);
100 
104  bool empty() const;
105 
106 public: // Access Operations
110  MapMetaData const &getMetaData() const;
111 
116 
125 
130  lane::LaneIdList getLanes() const;
131 
137  lane::LaneIdList getLanes(PartitionId const &partition_id) const;
138 
145  lane::LaneIdList getLanes(std::string const &type_filter, bool is_hov) const;
146 
154  lane::LaneIdList getLanes(PartitionId partition_id, std::string const &type_filter, bool is_hov) const;
155 
162 
171 
177 
183  void removePartition(PartitionId partition_id);
184 
189  physics::Distance getCumulativeLaneLength() const;
190 
191  bool isValid() const;
192 
197 
198 private:
199  bool serialize(serialize::ISerializer &serializer);
205  bool storeGeometry(GeometryStore &gs);
206 
212  bool restoreGeometry(const GeometryStore &gs);
213 
219  bool checkGeometry(const GeometryStore &gs);
220 
221 private: // Constructor
222  bool use_magic_;
223  bool use_embedded_geometry_;
224  bool use_geometry_store_;
225 
226  typedef std::map<lane::LaneId, lane::Lane::Ptr> LaneMap;
227  typedef std::map<landmark::LandmarkId, landmark::Landmark::Ptr> LandmarkMap;
228  typedef std::map<PartitionId, lane::LaneIdList> PartLaneMap;
229  typedef std::map<PartitionId, landmark::LandmarkIdList> PartLandmarkMap;
230 
231  MapMetaData meta_data_;
232  LaneMap lane_map_;
233  LandmarkMap landmark_map_;
234  PartLaneMap part_lane_map_;
235  PartLandmarkMap part_landmark_map_;
236 };
237 
238 } // namespace access
239 } // namespace map
240 } // namespace ad
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::access::Store
Autonomus Driving Map Store.
Definition: Store.hpp:40
ad::map::access::isValid
bool isValid(MapMetaData const &metaData, bool const logErrors=true)
checks if the given MapMetaData is valid
Definition: Operation.hpp:39
ad::map::serialize::ISerializer
Interface for Serializer.
Definition: ISerializer.hpp:34
ISerializer.hpp
ad::map::access::Store::getBoundingSphere
point::BoundingSphere getBoundingSphere() const
ad::map::access::MapMetaData
DataType MapMetaData.
Definition: MapMetaData.hpp:44
ad::map::landmark::LandmarkId
DataType LandmarkId.
Definition: LandmarkId.hpp:66
ad::map::lane::LaneIdList
std::vector<::ad::map::lane::LaneId > LaneIdList
DataType LaneIdList.
Definition: LaneIdList.hpp:44
ad::map::access::Store::getLandmarks
landmark::LandmarkIdList getLandmarks() const
Method to be called to retrieve identifiers of all Landmarks in the Store.
ad::map::access::Store::Ptr
std::shared_ptr< Store > Ptr
Smart pointer to the Store.
Definition: Store.hpp:46
ad::map::landmark::LandmarkIdList
std::vector<::ad::map::landmark::LandmarkId > LandmarkIdList
DataType LandmarkIdList.
Definition: LandmarkIdList.hpp:44
ad::map::access::Store::save
bool save(serialize::ISerializer &serializer, bool use_magic=true, bool use_embedded_geometry=true, bool use_geometry_store=false)
Save current AD Map Data Store.
ad::map::lane::LaneId
DataType LaneId.
Definition: LaneId.hpp:66
ad::map::access::Store::operator=
Store & operator=(Store const &other)=delete
Copy operator deleted.
ad::map::match::AdMapMatching
performs map matching of a given point to the map
Definition: AdMapMatching.hpp:38
ad::map::access::Store::getLanes
lane::LaneIdList getLanes() const
Method to be called to retrieve identifiers of all Lanes in the Store.
ad::map::access::PartitionId
DataType PartitionId.
Definition: PartitionId.hpp:66
Types.hpp
ad::map::access::Store::removePartition
void removePartition(PartitionId partition_id)
Method to be called to remove all content belonging to specific partition and the partition itself.
ad::map::point::BoundingSphere
DataType BoundingSphere.
Definition: BoundingSphere.hpp:46
ad::map::access::Store::getLanePtr
lane::Lane::ConstPtr getLanePtr(lane::LaneId const &id) const
Method to be called to retrieve Lane from the Store.
ad::map::access::PartitionIdList
std::vector<::ad::map::access::PartitionId > PartitionIdList
DataType PartitionIdList.
Definition: PartitionIdList.hpp:42
ad::map::access::Store::load
bool load(serialize::ISerializer &serializer)
Load data into the AD Map Data Store.
ad::map::landmark::Landmark::ConstPtr
std::shared_ptr< Landmark const > ConstPtr
Smart pointer on constant Landmark.
Definition: Landmark.hpp:61
ad::map::access::Store::~Store
virtual ~Store()
Destructor. Releases all resources.
ad::map::access::Store::getMetaData
const MapMetaData & getMetaData() const
Types.hpp
ad::map::access::Store::getLandmarkPtr
landmark::Landmark::ConstPtr getLandmarkPtr(landmark::LandmarkId id) const
Method to be called to retrieve Landmark from the Store.
ad::map::access::Factory
Autonomus Driving Map Factory. Contains method to be used to initialize and modify content in the Sto...
Definition: Factory.hpp:36
ad::map::access::Store::getPartitions
PartitionIdList getPartitions() const
ad::map::access::Store::Store
Store()
Constructor. Initializes empty Store.
Types.hpp
ad::map::access::Store::getCumulativeLaneLength
physics::Distance getCumulativeLaneLength() const
Calculates cumulative length of the all lanes in the store.
ad::map::lane::Lane::ConstPtr
std::shared_ptr< Lane const > ConstPtr
Smart pointer on constant Lane.
Definition: Lane.hpp:66
ad::map::access::Store::empty
bool empty() const