5 #include <boost/variant/variant.hpp> 15 template <
typename ValueT>
17 using Type = std::decay_t<ValueT>;
19 template <
typename ValueT>
37 using Cache = boost::variant<bool, double, Id, int, Velocity>;
40 Attribute(
const std::string& value) : value_{value} {}
41 Attribute(std::string&& value) : value_{std::move(value)} {}
96 const std::string&
value()
const {
return value_; }
102 void setValue(
const std::string& value);
171 return value().c_str();
176 return value().c_str();
204 static constexpr
const char Type[] =
"type";
205 static constexpr
const char Subtype[] =
"subtype";
206 static constexpr
const char OneWay[] =
"one_way";
210 static constexpr
const char Location[] =
"location";
211 static constexpr
const char Dynamic[] =
"dynamic";
212 static constexpr
const char Color[] =
"color";
216 static constexpr
const char Ele[] =
"ele";
219 static constexpr
const char LaneChange[] =
"lane_change";
220 static constexpr
const char LaneChangeLeft[] =
"lane_change:left";
221 static constexpr
const char LaneChangeRight[] =
"lane_change:right";
222 static constexpr
const char Name[] =
"name";
223 static constexpr
const char Region[] =
"region";
226 static constexpr
const char SpeedLimitMandatory[] =
"speed_limit_mandatory";
227 static constexpr
const char Participant[] =
"participant";
228 static constexpr
const char Area[] =
"area";
229 static constexpr
const char Fallback[] =
"fallback";
230 static constexpr
const char Width[] =
"width";
231 static constexpr
const char Height[] =
"height";
232 static constexpr
const char Temporary[] =
"temporary";
235 static constexpr
const char SignType[] =
"sign_type";
250 static std::string
tag(
const std::string& participant) {
253 static constexpr
const char Vehicle[] =
"vehicle";
254 static constexpr
const char VehicleBus[] =
"vehicle:bus";
255 static constexpr
const char VehicleCar[] =
"vehicle:car";
256 static constexpr
const char VehicleCarElectric[] =
"vehicle:car:electric";
257 static constexpr
const char VehicleCarCombustion[] =
"vehicle:car:combustion";
258 static constexpr
const char VehicleTruck[] =
"vehicle:truck";
259 static constexpr
const char VehicleMotorcycle[] =
"vehicle:motorcycle";
260 static constexpr
const char VehicleTaxi[] =
"vehicle:taxi";
261 static constexpr
const char VehicleEmergency[] =
"vehicle:emergency";
262 static constexpr
const char Pedestrian[] =
"pedestrian";
263 static constexpr
const char Bicycle[] =
"bicycle";
264 static constexpr
const char Train[] =
"train";
273 static constexpr
const char Node[] =
"node";
274 static constexpr
const char Way[] =
"way";
275 static constexpr
const char Relation[] =
"relation";
276 static constexpr
const char Lanelet[] =
"lanelet";
278 static constexpr
const char Multipolygon[] =
"multipolygon";
281 static constexpr
const char LineThick[] =
"line_thick";
282 static constexpr
const char LineThin[] =
"line_thin";
283 static constexpr
const char Curbstone[] =
"curbstone";
284 static constexpr
const char GuardRail[] =
"guard_rail";
285 static constexpr
const char RoadBorder[] =
"road_border";
286 static constexpr
const char Wall[] =
"wall";
287 static constexpr
const char Fence[] =
"fence";
288 static constexpr
const char Zebra[] =
"zebra_marking";
289 static constexpr
const char PedestrianMarking[] =
"pedestrian_marking";
290 static constexpr
const char BikeMarking[] =
"bike_marking";
291 static constexpr
const char Keepout[] =
"keepout";
292 static constexpr
const char StopLine[] =
"stop_line";
293 static constexpr
const char Virtual[] =
"virtual";
294 static constexpr
const char Visualization[] =
"visualization";
295 static constexpr
const char ZigZag[] =
"zig-zag";
296 static constexpr
const char LiftGate[] =
"lift_gate";
297 static constexpr
const char JerseyBarrier[] =
"jersey_barrier";
298 static constexpr
const char Gate[] =
"gate";
299 static constexpr
const char Door[] =
"door";
300 static constexpr
const char Trajectory[] =
"trajectory";
301 static constexpr
const char Rail[] =
"rail";
302 static constexpr
const char Bump[] =
"bump";
305 static constexpr
const char Solid[] =
"solid";
306 static constexpr
const char Dashed[] =
"dashed";
307 static constexpr
const char DashedSolid[] =
"dashed_solid";
308 static constexpr
const char SolidDashed[] =
"solid_dashed";
309 static constexpr
const char SolidSolid[] =
"solid_solid";
310 static constexpr
const char Straight[] =
"straight";
311 static constexpr
const char Left[] =
"left";
312 static constexpr
const char Right[] =
"right";
313 static constexpr
const char StraightLeft[] =
"straight_left";
314 static constexpr
const char StraightRight[] =
"straight_right";
315 static constexpr
const char LeftRight[] =
"left_right";
316 static constexpr
const char High[] =
"high";
317 static constexpr
const char Low[] =
"low";
320 static constexpr
const char Arrow[] =
"arrow";
321 static constexpr
const char Pole[] =
"pole";
322 static constexpr
const char Post[] =
"post";
323 static constexpr
const char Symbol[] =
"symbol";
324 static constexpr
const char Start[] =
"start";
325 static constexpr
const char End[] =
"end";
326 static constexpr
const char Dot[] =
"dot";
329 static constexpr
const char RedYellowGreen[] =
"red_yellow_green";
330 static constexpr
const char RedGreen[] =
"red_green";
331 static constexpr
const char RedYellow[] =
"red_yellow";
332 static constexpr
const char Red[] =
"red";
333 static constexpr
const char Yellow[] =
"yellow";
334 static constexpr
const char White[] =
"white";
337 static constexpr
const char Road[] =
"road";
338 static constexpr
const char Highway[] =
"highway";
339 static constexpr
const char PlayStreet[] =
"play_street";
340 static constexpr
const char EmergencyLane[] =
"emergency_lane";
341 static constexpr
const char BusLane[] =
"bus_lane";
342 static constexpr
const char BicycleLane[] =
"bicycle_lane";
343 static constexpr
const char Walkway[] =
"walkway";
344 static constexpr
const char SharedWalkway[] =
"shared_walkway";
345 static constexpr
const char Crosswalk[] =
"crosswalk";
346 static constexpr
const char Stairs[] =
"stairs";
349 static constexpr
const char Nonurban[] =
"nonurban";
350 static constexpr
const char Urban[] =
"urban";
351 static constexpr
const char Private[] =
"private";
354 static constexpr
const char Parking[] =
"parking";
355 static constexpr
const char Freespace[] =
"freespace";
356 static constexpr
const char Vegetation[] =
"vegetation";
357 static constexpr
const char Building[] =
"building";
358 static constexpr
const char TrafficIsland[] =
"traffic_island";
359 static constexpr
const char Exit[] =
"exit";
374 for (
const auto& o : obj) {
375 stream << o.first <<
": " << o.second <<
" ";
Attribute(std::string &&value)
Represents a speed limit that affects a laneletA speed limit is defined by one ore more traffic signs...
boost::variant< bool, double, Id, int, Velocity > Cache
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
const std::string & value() const
gets the value of this attribute
Attribute(const char *value)
The famous (mutable) lanelet class.
bool operator==(const Attribute &lhs, const Attribute &rhs)
Defines right of way restrictions.
Represents a traffic light restriction on the lanelet.
static constexpr const char Participant[]
std::decay_t< ValueT > Type
boost::optional< T > Optional
Common values for attributes are defined here.
bool operator!=(const Attribute &lhs, const Attribute &rhs)
Lists which attribute strings are mapped to which enum value.
Attribute(const std::string &value)
static std::string tag(const std::string &participant)
Obtain the tag for the participant override.
std::shared_ptr< Cache > cache_
cache for the last queried value
parts of tag that have to be combined with either Participants:, OneWay: or SpeedLimit to generate an...
An attribute represents one value of a tag of a lanelet primitive.
Famous Area class that represents a basic area as element of the map.
typename internal::ValueOf< T >::Type ValueOfT
std::string value_
internal value of this parameter
A general rule or limitation for a lanelet (abstract base class)
Expresses a generic traffic sign rule.
std::pair< const char *, const AttributeName > AttributeNamesItem
Defines an all way stop. These are a special form of right of way, where all lanelets have to yield...
AttributeName
Typical Attributes names within lanelet.
units::MPSQuantity Velocity