ad_map_access
Factory.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 <memory>
15 #include <string>
16 
17 #include "ad/map/access/Types.hpp"
19 #include "ad/map/lane/Types.hpp"
20 #include "ad/map/point/Types.hpp"
22 
24 namespace ad {
26 namespace map {
28 namespace access {
29 
30 class Store;
31 
36 class Factory
37 {
38 public: // Constructor/Destructor
43  explicit Factory(Store &store)
44  : mStore(store)
45  {
46  }
47 
52  virtual ~Factory() = default;
53 
54 public: // Atomic Operations -- Main
63  bool add(PartitionId part_id, const lane::LaneId &id, lane::LaneType type, lane::LaneDirection direction);
64 
73  lane::LaneId add(PartitionId part_id, const point::GeoEdge &left_geo, const point::GeoEdge &right_geo);
74 
87  const point::ECEFEdge &left_ecef,
88  const point::ECEFEdge &right_ecef,
89  const lane::LaneId &lane_id_0,
90  const lane::LaneId &lane_id_1);
91 
102  bool addLandmark(PartitionId part_id,
103  const landmark::LandmarkId &id,
104  const landmark::LandmarkType type,
105  const point::ECEFPoint &position,
106  const point::ECEFPoint &orientation,
107  const point::Geometry &bounding_box);
108 
119  bool addTrafficLight(PartitionId part_id,
120  const landmark::LandmarkId &id,
121  const landmark::TrafficLightType type,
122  const point::ECEFPoint &position,
123  const point::ECEFPoint &orientation,
124  const point::Geometry &bounding_box);
125 
137  bool addTrafficSign(PartitionId part_id,
138  const landmark::LandmarkId &id,
139  const landmark::TrafficSignType type,
140  const point::ECEFPoint &position,
141  const point::ECEFPoint &orientation,
142  const point::Geometry &bounding_box,
143  const std::string &text);
144 
145 private:
159  bool add(PartitionId part_id,
160  const landmark::LandmarkId &id,
161  const landmark::LandmarkType type,
162  const point::ECEFPoint &position,
163  const point::ECEFPoint &orientation,
164  const point::Geometry &bounding_box,
165  const landmark::TrafficLightType traffic_light_type,
166  const landmark::TrafficSignType traffic_sign_type,
167  const std::string &text);
168 
169 public: // Atomic Operations -- Add Lane Attribute
176  bool add(const lane::LaneId &id, const lane::ContactLane &contact_lane);
177 
184  bool add(const lane::LaneId &id, const lane::ContactLaneList &contact_lanes);
185 
192  bool add(const lane::LaneId &id, const restriction::SpeedLimit &para_speed);
193 
200  bool add(const lane::LaneId &id, const landmark::LandmarkId &landmark);
201 
209  bool add(const lane::LaneId &id, const restriction::Restriction &restriction, bool andx);
210 
220  bool add(const lane::LaneId &id_from,
221  const lane::LaneId &id_to,
222  const lane::ContactLocation location,
223  const lane::ContactTypeList &types,
224  const restriction::Restrictions &restrs);
225 
236  bool add(const lane::LaneId &id_from,
237  const lane::LaneId &id_to,
238  const lane::ContactLocation location,
239  const lane::ContactTypeList &types,
240  const restriction::Restrictions &restrs,
241  const landmark::LandmarkId &traffic_light);
242 
243 public: // Atomic Operations -- Set Lane Attribute
250  bool set(const lane::LaneId &id, lane::LaneDirection direction);
251 
258  bool set(const lane::LaneId &id, lane::LaneType type);
259 
266  bool set(const lane::LaneId &id, lane::ComplianceVersion compliance_ver);
267 
275  bool set(const lane::LaneId &id, const point::Geometry &edge_left, const point::Geometry &edge_right);
276 
283  bool set(const lane::LaneId &id, const physics::Speed &speed_limit);
284 
291  bool set(const lane::LaneId &id, const restriction::Restrictions &restrictions);
292 
299  bool set(const lane::LaneId &id, const landmark::LandmarkIdList &landmarks);
300 
301 public: // Atomic Operations -- Set Map Meta Data
307  bool set(const TrafficType &traffic_type);
308 
309 public: // Atomic operations -- remove things
315  bool deleteLane(lane::LaneId id);
316 
323  bool deleteContacts(lane::LaneId from_id, lane::LaneId to_id);
324 
331 
332 public: // Other methods
340  bool autoConnect(lane::LaneId from_lane_id, lane::LaneId to_lane_id);
341 
342 private: // Aux Methods
346  lane::LaneId getNextLaneId() const;
347 
348 protected: // Data Members
350 };
351 
352 } // namespace access
353 } // namespace map
354 } // namespace ad
ad
namespace ad
Definition: GeometryStoreItem.hpp:28
ad::map::access::Factory::deleteLane
bool deleteLane(lane::LaneId id)
Method to be called to delete Lane from the Store.
ad::map::access::Store
Autonomus Driving Map Store.
Definition: Store.hpp:40
ad::map::restriction::Restrictions
DataType Restrictions.
Definition: Restrictions.hpp:42
ad::map::access::Factory::add
bool add(PartitionId part_id, const lane::LaneId &id, lane::LaneType type, lane::LaneDirection direction)
Adds or modifies new Lane in the Store.
ad::map::lane::ContactLaneList
std::vector<::ad::map::lane::ContactLane > ContactLaneList
DataType ContactLaneList.
Definition: ContactLaneList.hpp:42
ad::map::access::Factory::deleteLandmark
bool deleteLandmark(landmark::LandmarkId id)
Method to be called to delete landmark from the Store.
ad::map::lane::ContactLocation
ContactLocation
DataType ContactLocation.
Definition: ContactLocation.hpp:43
ad::map::landmark::LandmarkId
DataType LandmarkId.
Definition: LandmarkId.hpp:66
ad::map::access::Factory::autoConnect
bool autoConnect(lane::LaneId from_lane_id, lane::LaneId to_lane_id)
Creates missing topological contacts from one lane to another.
ad::map::lane::ContactTypeList
std::vector<::ad::map::lane::ContactType > ContactTypeList
DataType ContactTypeList.
Definition: ContactTypeList.hpp:44
ad::map::restriction::Restriction
DataType Restriction.
Definition: Restriction.hpp:44
ad::map::restriction::SpeedLimit
DataType SpeedLimit.
Definition: SpeedLimit.hpp:44
ad::map::landmark::LandmarkIdList
std::vector<::ad::map::landmark::LandmarkId > LandmarkIdList
DataType LandmarkIdList.
Definition: LandmarkIdList.hpp:44
ad::map::landmark::TrafficSignType
TrafficSignType
DataType TrafficSignType.
Definition: TrafficSignType.hpp:43
ad::map::lane::LaneId
DataType LaneId.
Definition: LaneId.hpp:66
ad::map::lane::ComplianceVersion
uint64_t ComplianceVersion
DataType ComplianceVersion.
Definition: ComplianceVersion.hpp:41
ad::map::landmark::TrafficLightType
TrafficLightType
DataType TrafficLightType.
Definition: TrafficLightType.hpp:43
ad::map::access::PartitionId
DataType PartitionId.
Definition: PartitionId.hpp:66
Types.hpp
ad::map::access::Factory::Factory
Factory(Store &store)
Constructor.
Definition: Factory.hpp:43
ad::map::access::Factory::addTrafficSign
bool addTrafficSign(PartitionId part_id, const landmark::LandmarkId &id, const landmark::TrafficSignType type, const point::ECEFPoint &position, const point::ECEFPoint &orientation, const point::Geometry &bounding_box, const std::string &text)
Adds or modifies new traffic sign landmark in the Store.
Types.hpp
ad::map::access::Factory::set
bool set(const lane::LaneId &id, lane::LaneDirection direction)
Sets the lane attribute.
Types.hpp
Types.hpp
ad::map::lane::ContactLane
DataType ContactLane.
Definition: ContactLane.hpp:47
ad::map::point::GeoEdge
std::vector<::ad::map::point::GeoPoint > GeoEdge
DataType GeoEdge.
Definition: GeoEdge.hpp:42
ad::map::point::Geometry
DataType Geometry.
Definition: Geometry.hpp:45
ad::map::point::ECEFPoint
DataType ECEFPoint.
Definition: ECEFPoint.hpp:45
ad::map::access::Factory::deleteContacts
bool deleteContacts(lane::LaneId from_id, lane::LaneId to_id)
Delete all contacts from one lane to another.
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::landmark::LandmarkType
LandmarkType
DataType LandmarkType.
Definition: LandmarkType.hpp:43
ad::map::lane::LaneType
LaneType
DataType LaneType.
Definition: LaneType.hpp:43
ad::map::point::ECEFEdge
std::vector<::ad::map::point::ECEFPoint > ECEFEdge
DataType ECEFEdge.
Definition: ECEFEdge.hpp:42
ad::map::access::Factory::mStore
Store & mStore
Store on which this Factory operates.
Definition: Factory.hpp:349
Types.hpp
ad::map::access::TrafficType
TrafficType
DataType TrafficType.
Definition: TrafficType.hpp:43
ad::map::access::Factory::addTrafficLight
bool addTrafficLight(PartitionId part_id, const landmark::LandmarkId &id, const landmark::TrafficLightType type, const point::ECEFPoint &position, const point::ECEFPoint &orientation, const point::Geometry &bounding_box)
Adds or modifies new traffic light landmark in the Store.
ad::map::lane::LaneDirection
LaneDirection
DataType LaneDirection.
Definition: LaneDirection.hpp:43
ad::map::access::Factory::addLandmark
bool addLandmark(PartitionId part_id, const landmark::LandmarkId &id, const landmark::LandmarkType type, const point::ECEFPoint &position, const point::ECEFPoint &orientation, const point::Geometry &bounding_box)
Adds or modifies new landmark in the Store.
ad::map::access::Factory::~Factory
virtual ~Factory()=default
Destructor. Releases all resources.