Vanetza
Loading...
Searching...
No Matches
position_updater.hpp
1
#ifndef POSITION_UPDATER_HPP_KMWXTJRO
2
#define POSITION_UPDATER_HPP_KMWXTJRO
3
4
#include <vanetza/common/clock.hpp>
5
#include <vanetza/units/frequency.hpp>
6
7
namespace
vanetza
8
{
9
10
// forward declarations
11
class
Runtime;
12
class
PositionProvider;
13
namespace
geonet {
class
Router; }
14
15
namespace
geonet
16
{
17
18
/**
19
* PositionUpdater helps updating a Router's position vector periodically
20
*/
21
class
PositionUpdater
22
{
23
public
:
24
/**
25
* Create PositionUpdater scheduling position updates read from position provider
26
* \note the default update rate is derived from router's MIB.
27
* \param runtime where updater schedules its callback
28
* \param pos position updates are read from this source
29
* \param router position sink
30
*/
31
PositionUpdater
(
Runtime
& runtime,
PositionProvider
& pos,
Router
& router);
32
~PositionUpdater
();
33
34
/**
35
* Change rate at which update is looking up new positions
36
* \note MIB setting is not affected
37
* \note an update interval smaller than zero disables updates
38
* \param interval update interval
39
*/
40
void
update_rate
(Clock::duration interval);
41
void
update_rate
(units::Frequency);
42
43
private
:
44
void
schedule();
45
46
Runtime
& m_runtime;
47
PositionProvider
& m_positioning;
48
Router
& m_router;
49
Clock::duration m_interval;
50
};
51
52
}
// namespace geonet
53
}
// namespace vanetza
54
55
#endif
/* POSITION_UPDATER_HPP_KMWXTJRO */
56
vanetza::PositionProvider
Definition:
position_provider.hpp:16
vanetza::Runtime
Definition:
runtime.hpp:16
vanetza::geonet::PositionUpdater
Definition:
position_updater.hpp:22
vanetza::geonet::PositionUpdater::update_rate
void update_rate(Clock::duration interval)
Definition:
position_updater.cpp:34
vanetza::geonet::Router
Definition:
router.hpp:74
vanetza
geonet
position_updater.hpp
Generated on Thu Nov 30 2023 12:03:35 for Vanetza by
1.9.6