Files
eden-sim/contrib/tsn/model/clock-constant-drift.h

57 lines
1.2 KiB
C++

#ifndef CONSTANTDRIFTCLOCK_H
#define CONSTANTDRIFTCLOCK_H
#include "ns3/object.h"
#include "ns3/nstime.h"
#include "ns3/clock.h"
namespace ns3
{
class ConstantDriftClock: public Clock
{
public:
/**
* \brief Get the TypeId
*
* \return The TypeId for this class
*/
static TypeId GetTypeId();
/**
* \brief Create a ConstantDriftClock
*/
ConstantDriftClock();
/**
* Destroy a ConstantDriftClock
*
* This is the destructor for the ConstantDriftClock.
*/
~ConstantDriftClock() override;
// Delete copy constructor and assignment operator to avoid misuse
ConstantDriftClock& operator=(const ConstantDriftClock&) = delete;
ConstantDriftClock(const ConstantDriftClock&) = delete;
Time GetLocalTime() override;
Time GetUncorrectedLocalTime() override;
Time GetTimeAt(Time t) override;
Time GetDuration(Time t) override;
void UpdateTime() override;
protected:
private:
Time m_initialOffset;
bool m_IsInitialised = false;
Time m_lastUpdateTime;
Time m_lastUpdateTimeValue;
double m_driftRate;
};
}
#endif /* CONSTANTDRIFTCLOCK_H */