YARP
Yet Another Robot Platform
NetworkClock.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_OS_NETWORKCLOCK_H
7 #define YARP_OS_NETWORKCLOCK_H
8 
9 #include <yarp/os/api.h>
10 
11 #include <yarp/os/Clock.h>
12 
13 #include <string>
14 
15 namespace yarp {
16 namespace os {
17 
19 {
20 public:
21  NetworkClock();
22  virtual ~NetworkClock();
23 
24  bool open(const std::string& clockSourcePortName, std::string localPortName = "");
25 
26  double now() override;
27  void delay(double seconds) override;
28  bool isValid() const override;
29 
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 private:
32  class Private;
33  Private* mPriv;
34 #endif // DOXYGEN_SHOULD_SKIP_THIS
35 };
36 
37 } // namespace os
38 } // namespace yarp
39 
40 
41 #endif // YARP_OS_NETWORKCLOCK_H
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
double now()
Return the current time in seconds, relative to an arbitrary starting point.
Definition: Time.cpp:121
void delay(double seconds)
Wait for a certain number of seconds.
Definition: Time.cpp:111
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_os_API
Definition: api.h:18