ad_rss
RssConstellationIdProvider.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: LGPL-2.1-only
6 //
7 // ----------------- END LICENSE BLOCK -----------------------------------
12 #pragma once
13 
14 #include <map>
15 #include <set>
19 
23 namespace ad {
27 namespace rss {
31 namespace structured {
32 
39 {
40 public:
45 
50 
60  world::Constellation const &constellation);
61 
69  void dropConstellationIds(world::ObjectId const &object_id);
70 
71 private:
72  struct ConstellationData
73  {
74  ConstellationData(world::TimeIndex time_index,
75  core::RelativeConstellationId const constellation_id,
76  world::Constellation const &constellation);
82  bool updateConstellation(world::TimeIndex time_index, world::Constellation const &constellation);
83 
84  typedef std::set<world::LaneSegmentId> IntersectionArea;
85 
94  bool isSmallerOrEqual(IntersectionArea const &left, IntersectionArea const &right) const;
95 
99  IntersectionArea getIntersectionArea(world::RoadArea const &roadArea);
100 
101  world::TimeIndex mTimeIndex;
102  world::ConstellationType mConstellationType;
103  core::RelativeConstellationId mConstellationId;
104  IntersectionArea mEgoVehicleIntersectionArea;
105  IntersectionArea mObjectIntersectionArea;
106  };
107 
113  void updateTime(world::TimeIndex const &time_index);
114 
118  core::RelativeConstellationId getFreeConstellationId();
119 
120  typedef std::multimap<world::ObjectId, ConstellationData> ConstellationDataMap;
121 
122  world::TimeIndex mCurrentTime{0};
123  world::TimeIndex mLastTime{0};
124  core::RelativeConstellationId mNextConstellationId{0};
125  ConstellationDataMap mConstellationData;
126 };
127 
128 } // namespace structured
129 } // namespace rss
130 } // namespace ad
class supporting to keep track of unique constellation ids
Definition: RssConstellationIdProvider.hpp:39
core::RelativeConstellationId getConstellationId(world::TimeIndex const &time_index, world::Constellation const &constellation)
get the constellation id of the given constellation
~RssConstellationIdProvider()=default
default destructor
void dropConstellationIds(world::ObjectId const &object_id)
drop all constallation ids associated with a given object_id
RssConstellationIdProvider()=default
default constructor
uint64_t RelativeConstellationId
DataType RelativeConstellationId.
Definition: RelativeConstellationId.hpp:39
std::vector<::ad::rss::world::RoadSegment > RoadArea
DataType RoadArea.
Definition: RoadArea.hpp:43
ConstellationType
DataType ConstellationType.
Definition: ConstellationType.hpp:44
uint64_t ObjectId
DataType ObjectId.
Definition: ObjectId.hpp:39
uint64_t TimeIndex
DataType TimeIndex.
Definition: TimeIndex.hpp:39
namespace ad
Definition: LateralRelativePosition.hpp:28
DataType Constellation.
Definition: Constellation.hpp:49