ad_rss_map_integration
TimePointOstream.hpp
Go to the documentation of this file.
1 /*
2  * ----------------- BEGIN LICENSE BLOCK ---------------------------------
3  *
4  * Copyright (C) 2018-2020 Intel Corporation
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only
7  *
8  * ----------------- END LICENSE BLOCK -----------------------------------
9  */
10 
18 #pragma once
19 
20 #include <chrono>
21 #include <iomanip>
22 #include <iostream>
23 
24 #if __cplusplus <= 201703L
25 
26 namespace std {
27 namespace chrono {
28 
29 inline std::ostream &operator<<(std::ostream &os, system_clock::time_point const &value)
30 {
31  std::ios::fmtflags os_flags(os.flags());
32  std::time_t t = std::chrono::system_clock::to_time_t(value);
33  os << std::put_time(std::localtime(&t), "%d.%m.%Y-%H:%M:%S");
34  os << "." << std::setfill('0') << std::setw(3)
35  << (std::chrono::duration_cast<std::chrono::milliseconds>(value.time_since_epoch()).count() % 1000);
36  os.flags(os_flags);
37  return os;
38 }
39 
40 } // namespace chrono
41 } // namespace std
42 
43 #endif
std::ostream & operator<<(std::ostream &os, RouteAccelerations const &_value)
standard ostream operator
Definition: RouteAccelerations.hpp:194