NetworkClock Class Reference
A Clock interface implementation that uses gz::msgs::Clock messages distributed across the network. More...
#include <Clock.hh>
Public Types | |
| enum class | TimeBase : int64_t { REAL , SIM , SYS } | 
| Network clock time bases.  More... | |
Public Member Functions | |
| NetworkClock (const std::string &_topicName, const TimeBase _timeBase=TimeBase::SIM) | |
| Constructor that sets the initial time range option.   | |
| ~NetworkClock () override | |
| Destructor.   | |
| bool | IsReady () const override | 
| Checks whether the clock is ready to be used or not.   | |
| void | SetTime (const std::chrono::nanoseconds _time) | 
| Sets and distributes the given clock time.   | |
| std::chrono::nanoseconds | Time () const override | 
| Gets clock time.   | |
  Public Member Functions inherited from Clock | |
| virtual | ~Clock ()=default | 
| Virtual destructor.   | |
Detailed Description
A Clock interface implementation that uses gz::msgs::Clock messages distributed across the network.
Member Enumeration Documentation
◆ TimeBase
      
  | 
  strong | 
Constructor & Destructor Documentation
◆ NetworkClock()
      
  | 
  explicit | 
Constructor that sets the initial time range option.
- Parameters
 - 
  
[in] _topicName Name of the gz::msgs::Clock type topic to be used [in] _timeBase Time base for this clock, defaults to simulation time  
◆ ~NetworkClock()
      
  | 
  override | 
Destructor.
Member Function Documentation
◆ IsReady()
      
  | 
  overridevirtual | 
Checks whether the clock is ready to be used or not.
- Returns
 - True if clock is ready to be used, false otherwise
 
Implements Clock.
◆ SetTime()
| void SetTime | ( | const std::chrono::nanoseconds | _time | ) | 
Sets and distributes the given clock time.
- Parameters
 - 
  
[in] _time The clock time to be set  
- Remarks
 - No clock arbitration is performed
 
◆ Time()
      
  | 
  overridevirtual | 
The documentation for this class was generated from the following file:
 Public Member Functions inherited from