Go to the documentation of this file.
2 #include <boost/variant.hpp>
10 template <
typename LineStringT,
typename PolygonT>
40 explicit operator const LineStringT&()
const {
return boost::get<LineStringT>(
lsOrPoly_); }
43 explicit operator const PolygonT&()
const {
return boost::get<PolygonT>(
lsOrPoly_); }
46 template <
typename VisitorT>
48 return boost::apply_visitor(visitor,
lsOrPoly_);
53 return applyVisitor([](
auto& elem) {
return elem.id(); });
63 const auto* ls = boost::get<LineStringT>(&
lsOrPoly_);
72 const auto* poly = boost::get<PolygonT>(&
lsOrPoly_);
73 if (poly !=
nullptr) {
97 template <
typename VisitorT>
99 return boost::apply_visitor(visitor,
lsOrPoly_);
129 return !(lhs == rhs);
136 obj.
applyVisitor([&stream](
auto& prim) { stream << prim; });
140 obj.
applyVisitor([&stream](
auto& prim) { stream << prim; });
bool isLineString() const
true if this objct holds a lineString
LineStringOrPolygonBase & operator=(LineStringOrPolygonBase &&rhs)=default
ConstRuleParameter asRuleParameter() const
LineStringOrPolygonBase & operator=(LineStringT linestring)
std::vector< ConstLineStringOrPolygon3d > ConstLineStringsOrPolygons3d
const AttributeMap & attributes() const
get the attributes of the linestring or polygon
bool operator==(const Attribute &lhs, const Attribute &rhs)
LineStringOrPolygonBase()=default
std::ostream & operator<<(std::ostream &stream, const Attribute &obj)
boost::variant< LineStringT, PolygonT > lsOrPoly_
RuleParameter asRuleParameter() const
ConstLineStringOrPolygon3d(const LineStringOrPolygon3d &lsOrPoly)
~LineStringOrPolygonBase() noexcept=default
Base class for objects that can either refer to linestrings or polygons.
boost::optional< T > Optional
boost::variant< ConstPoint3d, ConstLineString3d, ConstPolygon3d, ConstWeakLanelet, ConstWeakArea > ConstRuleParameter
Const-version of the parameters.
bool isPolygon() const
true if this object holds an polygon
bool equals(const LineStringOrPolygonBase &other) const
std::vector< LineStringOrPolygon3d > LineStringsOrPolygons3d
decltype(auto) applyVisitor(VisitorT visitor) const
apply a generic visitor
bool operator!=(const Attribute &lhs, const Attribute &rhs)
LineStringOrPolygonBase & operator=(PolygonT poly)
Id id() const
get the id of the linestring or polygon
LineStringOrPolygonBase(LineStringT linestring)
Optional< LineStringT > lineString() const
return the managed linestring
This class holds either a LineString3d or a Polygon3d.
Optional< PolygonT > polygon() const
get the managed polygon
LineStringOrPolygonBase(PolygonT polygon)
decltype(auto) applyVisitor(VisitorT visitor)
apply a generic visitor
This class holds either a ConstLineString3d or a ConstPolygon3d.
boost::variant< Point3d, LineString3d, Polygon3d, WeakLanelet, WeakArea > RuleParameter
lanelet2_core
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:25:52