ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
clocktimeconversion.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2023 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Matthias Nichting - initial implementation
13  ********************************************************************************/
14 
15 #include <rosgraph_msgs/Clock.h>
16 
17 #include <utility>
18 
20 {
21 
27  {
28  public:
29  void operator()(rosgraph_msgs::ClockConstPtr cl, std::pair<uint32_t, uint32_t> &value)
30  {
31  value.first = cl->clock.sec;
32  value.second = cl->clock.nsec;
33  }
34  void operator()(const rosgraph_msgs::Clock &cl, std::pair<uint32_t, uint32_t> &value)
35  {
36  value.first = cl.clock.sec;
37  value.second = cl.clock.nsec;
38  }
39  rosgraph_msgs::Clock operator()(const std::pair<uint32_t, uint32_t> &value)
40  {
41  rosgraph_msgs::Clock cl;
42  cl.clock.sec = value.first;
43  cl.clock.nsec = value.second;
44  return cl;
45  }
46  };
47 } // namespace adore_if_ros_scheduling
Definition: clocktimeconversion.h:27
void operator()(const rosgraph_msgs::Clock &cl, std::pair< uint32_t, uint32_t > &value)
Definition: clocktimeconversion.h:34
rosgraph_msgs::Clock operator()(const std::pair< uint32_t, uint32_t > &value)
Definition: clocktimeconversion.h:39
void operator()(rosgraph_msgs::ClockConstPtr cl, std::pair< uint32_t, uint32_t > &value)
Definition: clocktimeconversion.h:29
Definition: adore_if_ros_scheduling_constants.h:19