MIRA
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
TimeOffsetCompensation Class Reference

#include <fw/RemoteConnection.h>

Public Member Functions

 TimeOffsetCompensation (const TimeOffsetCompensation &other)
 
 TimeOffsetCompensation (const Duration &compensationInterval=Duration::seconds(10))
 
template<typename Reflector >
void reflect (Reflector &r)
 Reflect method for serialization. More...
 
bool isInitialized () const
 
Duration getCompensationInterval () const
 
void setCompensationInterval (const Duration &interval)
 
void setTargetOffset (const Duration &target, const Time &localTs)
 Set a new target offset. More...
 
Duration queryLocalOffset (const Time &localTs) const
 Query offset to apply on local timestamp. More...
 
Duration queryRemoteOffset (const Time &remoteTs) const
 Query offset to apply on remote timestamp. More...
 
TimeOffsetCompensationoperator= (TimeOffsetCompensation other)
 

Public Attributes

int mCompensationInterval
 
Duration mTargetOffset
 
Duration mStartOffset
 
Time mStartTime
 
boost::mutex mMutex
 

Protected Member Functions

Duration currentOffset () const
 For use in readonly property getter (info on current offset) More...
 
Duration offset (const Time &ts, bool local) const
 The actual offset calculation (interpolation between start and target offset) More...
 

Constructor & Destructor Documentation

◆ TimeOffsetCompensation() [1/2]

◆ TimeOffsetCompensation() [2/2]

TimeOffsetCompensation ( const Duration compensationInterval = Duration::seconds(10))
inlineexplicit

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

Reflect method for serialization.

◆ isInitialized()

bool isInitialized ( ) const
inline

◆ getCompensationInterval()

Duration getCompensationInterval ( ) const

◆ setCompensationInterval()

void setCompensationInterval ( const Duration interval)

◆ setTargetOffset()

void setTargetOffset ( const Duration target,
const Time localTs 
)

Set a new target offset.

The new clock offset value is frequently determined by the sync protocol, and set here to slowly align the offset that is actually applied to messages.

◆ queryLocalOffset()

Duration queryLocalOffset ( const Time localTs) const

Query offset to apply on local timestamp.

◆ queryRemoteOffset()

Duration queryRemoteOffset ( const Time remoteTs) const

Query offset to apply on remote timestamp.

◆ operator=()

TimeOffsetCompensation& operator= ( TimeOffsetCompensation  other)
inline

◆ currentOffset()

Duration currentOffset ( ) const
inlineprotected

For use in readonly property getter (info on current offset)

◆ offset()

Duration offset ( const Time ts,
bool  local 
) const
protected

The actual offset calculation (interpolation between start and target offset)

Member Data Documentation

◆ mCompensationInterval

int mCompensationInterval

◆ mTargetOffset

Duration mTargetOffset

◆ mStartOffset

Duration mStartOffset

◆ mStartTime

Time mStartTime

◆ mMutex

boost::mutex mMutex
mutable

The documentation for this class was generated from the following file: