0.4.1
Loading...
Searching...
No Matches
TimeBase.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file TimeBase.hpp
10/// @brief Keeps track of the current real/simulation time
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2021-01-28
13
14#pragma once
15
17
18namespace NAV::util::time
19{
20/// @brief Different Modes the Time Base class can work in
21enum class Mode : uint8_t
22{
23 REAL_TIME, ///< Computer clock will be added to last time update
24 POST_PROCESSING, ///< Time will be set by FlowExecutor only
25};
26
27/// @brief Set the time mode
28/// @param[in] mode Real time or postprocessing
29void SetMode(Mode mode);
30
31/// @brief Get the time mode
33
34/// @brief Get the current time.
35/// @return Pointer to the current time or nullptr if it is not known yet.
37
38/// @brief Set the current time object
39/// @param[in] insTime The new current time
40void SetCurrentTime(const InsTime& insTime);
41
42/// @brief Set the current time object to the computer time
44
45/// @brief Clears the current time object
46void ClearCurrentTime();
47
48// TODO: Remove this all. Nodes have to give the time to each other over links. Each message needs a time, not globally
49
50} // namespace NAV::util::time
The class is responsible for all time-related tasks.
The class is responsible for all time-related tasks.
Definition InsTime.hpp:710
Mode
Different Modes the Time Base class can work in.
Definition TimeBase.hpp:22
@ POST_PROCESSING
Time will be set by FlowExecutor only.
Definition TimeBase.hpp:24
@ REAL_TIME
Computer clock will be added to last time update.
Definition TimeBase.hpp:23
void ClearCurrentTime()
Clears the current time object.
Definition TimeBase.cpp:80
void SetCurrentTime(const InsTime &insTime)
Set the current time object.
Definition TimeBase.cpp:49
void SetMode(Mode mode)
Set the time mode.
Definition TimeBase.cpp:33
InsTime GetCurrentInsTime()
Get the current time.
Definition TimeBase.cpp:38
void SetCurrentTimeToComputerTime()
Set the current time object to the computer time.
Definition TimeBase.cpp:70
Mode GetMode()
Get the time mode.
Definition TimeBase.cpp:28