YARP
Yet Another Robot Platform
NetworkClock.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_NETWORKCLOCK_H
10 #define YARP_OS_NETWORKCLOCK_H
11 
12 #include <yarp/os/api.h>
13 
14 #include <yarp/os/Clock.h>
15 
16 #include <string>
17 
18 namespace yarp {
19 namespace os {
20 
22 {
23 public:
24  NetworkClock();
25  virtual ~NetworkClock();
26 
27  bool open(const std::string& clockSourcePortName, std::string localPortName = "");
28 
29  double now() override;
30  void delay(double seconds) override;
31  bool isValid() const override;
32 
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 private:
35  class Private;
36  Private* mPriv;
37 #endif // DOXYGEN_SHOULD_SKIP_THIS
38 };
39 
40 } // namespace os
41 } // namespace yarp
42 
43 
44 #endif // YARP_OS_NETWORKCLOCK_H
#define YARP_OS_API
Definition: api.h:19
The main, catch-all namespace for YARP.
Definition: numeric.h:47
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
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:309