Free Electron
BeaconTimeSyncI.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __BeaconTimeSyncI_h__
8 #define __BeaconTimeSyncI_h__
9 
10 namespace beacon
11 {
12 
13 /**************************************************************************//**
14  @brief Beacon for time synchronization
15 
16  @ingroup beacon
17 *//***************************************************************************/
18 class FE_DL_EXPORT BeaconTimeSyncI:
19  virtual public fe::Component,
20  public fe::CastableAs<BeaconTimeSyncI>
21 {
22 public:
23  /// @brief Does time synchronization with the Beacon
24  /// without registering it
25  virtual bool timeSyncWithBeacon(const char *ipAddress,
26  const uint16_t requestPort) = 0;
27 
28  /// @brief Returns the time offset between the clock on the Beacon
29  /// and the local processor
30  virtual int64_t getTimeOffset() = 0;
31 
32  /// @brief Returns the current time plus the offset to give you
33  /// the Beacon time
34  virtual int64_t getBeaconTime() = 0;
35 
36  /// @brief Returns the estimated latency between the server and the client
37  virtual int64_t getLatency() = 0;
38 };
39 
40 } // namespace beacon
41 
42 #endif // __BeaconTimeSyncI_h__
Base for all interfacable components.
Definition: Component.h:20
Definition: BeaconClient.cc:16
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192
Beacon for time synchronization.
Definition: BeaconTimeSyncI.h:18