Fixposition SDK 0.0.0-heads/main-0-g97f6014
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
time.hpp
Go to the documentation of this file.
1/**
2 * \verbatim
3 * ___ ___
4 * \ \ / /
5 * \ \/ / Copyright (c) Fixposition AG (www.fixposition.com) and contributors
6 * / /\ \ License: see the LICENSE file
7 * /__/ \__\
8 * \endverbatim
9 *
10 * @file
11 * @brief Fixposition SDK: to_json() helpers for some fpsdk::common::time types
12 */
13#ifndef __FPSDK_COMMON_TO_JSON_TIME_HPP__
14#define __FPSDK_COMMON_TO_JSON_TIME_HPP__
15
16/* LIBC/STL */
17
18/* EXTERNAL */
19#include <nlohmann/json.hpp>
20
21/* PACKAGE */
22#include "../time.hpp"
23
24#ifndef _DOXYGEN_ // not documenting these
25/* ****************************************************************************************************************** */
26namespace fpsdk::common::time {
27
28inline void to_json(nlohmann::json& j, const RosTime& t)
29{
30 j = nlohmann::json::array({ t.sec_, t.nsec_ });
31}
32
33} // namespace fpsdk::common::time
34/* ****************************************************************************************************************** */
35#endif // !_DOXYGEN_
36#endif // __FPSDK_COMMON_TO_JSON_TIME_HPP__
Time utilities.
Definition time.hpp:39
Minimal ros::Time() / rplcpp::Time implementation (that doesn't throw)
Definition time.hpp:156
Fixposition SDK: Time utilities.