Vanetza
 
Loading...
Searching...
No Matches
path_history.hpp
1#ifndef PATH_HISTORY_HPP_1ITSMS5I
2#define PATH_HISTORY_HPP_1ITSMS5I
3
4#include <vanetza/facilities/path_point.hpp>
5#include <boost/circular_buffer.hpp>
6#include <list>
7
8namespace vanetza
9{
10namespace facilities
11{
12
13/**
14 * Implementation of Path History Reference Design (Method One)
15 * \see NHTSA Document "VSC-A Final Report: Appendix B-2" from September 2011
16 */
18{
19public:
21
22 /**
23 * Consider one further path point for inclusion into path history
24 * \param a path point, expected to be newer than any previously given point
25 */
26 void addSample(const PathPoint&);
27
28 /**
29 * Get current reference point, i.e. last provided path point
30 * \return current reference point (fallback is a default constructed PathPoint)
31 */
32 const PathPoint& getReferencePoint() const;
33
34 /**
35 * Get concise list of path points
36 * \note previously given path points are only included if the algorithm
37 * presented in above mentioned document as "Method One" selects them
38 * \return list of path points, some given points might be omitted
39 */
40 const std::list<PathPoint>& getConcisePoints() const { return m_concise; }
41
42private:
43 void updateConcisePoints();
44 void truncateConcisePoints();
45 const PathPoint& starting() const;
46 const PathPoint& previous() const;
47 const PathPoint& next() const;
48
49 boost::circular_buffer<PathPoint> m_samples;
50 std::list<PathPoint> m_concise;
51};
52
53} // namespace facilities
54} // namespace vanetza
55
56#endif /* PATH_HISTORY_HPP_1ITSMS5I */
57
void addSample(const PathPoint &)
const PathPoint & getReferencePoint() const
const std::list< PathPoint > & getConcisePoints() const