Template Class LineStringImpl

Inheritance Relationships

Base Type

Class Documentation

template<typename ConstLineStringT>
class LineStringImpl : public lanelet::Primitive<ConstLineStringT>

Implementation template class that is common to all non-const types.

Public Types

using PointType = typename Base::MutablePointType
using iterator = internal::SelectLsIteratorT<PointType>
using SegmentType = typename Base::SegmentType

Public Functions

LineStringImpl() = default
template<typename OtherT>
inline explicit LineStringImpl(const LineStringImpl<OtherT> &other)

Construct from other (mutable!) LineStrings.

explicit LineStringImpl(const std::shared_ptr<const LineStringData>&, bool inverted) = delete
inline explicit LineStringImpl(const std::shared_ptr<LineStringData> &data, bool inverted)

Construct from linestring data.

inline LineStringImpl &operator=(std::vector<PointType> rhs)

Copy assign from a normal vector. The Id of this object is unchanged.

inline LineStringImpl &operator=(std::vector<Point3d> &&rhs)

Move assign from a normal vector. Id and attributes stay unchanged.

inline iterator insert(iterator position, const PointType &point)

Inserts an element at a specific position.

Just as you would expect from an std::vector… If you plan to insert more elements than one, use the ranged version below. That saves you from some unnecessary cache regenerations.

template<typename InIter>
inline iterator insert(iterator position, InIter start, InIter end)

Inserts an range of elements at a specific position.

inline void push_back(const PointType &point)

inserts a new element at the end

inline iterator erase(iterator position)

Removes point, returns iterator to the next point.

inline void pop_back()

removes element from the end

inline void reserve(size_t num)

request a change in capacity

inline void resize(size_t num)

Changes the number of points contained either by deleting them or by inserting new (invalId points).

inline void clear()

Remove all points, making the linestring invalid until new points are inserted.

inline iterator begin()

mutable iterator for the elements of this vector.

inline iterator end()

mutable iterator to the end of the elements of this vector.

inline PointType &front()

get a refernce to the first element (make sure it exists)

inline PointType &back()

get a reference to the last element if it exists

inline PointType &operator[](size_t idx)

access element at specific position

inline SegmentType segment(size_t idx) noexcept

returns the n-th segment. If n equals size() -1, the segment from back() to front() is returned.

Protected Types

using Base = Primitive<ConstLineStringT>

Protected Functions

LineStringImpl(LineStringImpl &&rhs) noexcept = default
LineStringImpl &operator=(LineStringImpl &&rhs) noexcept = default
LineStringImpl(const LineStringImpl &rhs) = default
LineStringImpl &operator=(const LineStringImpl &rhs) = default
~LineStringImpl() noexcept = default
inline Points3d &points()