Update README and add contrib dir
This commit is contained in:
56
contrib/tsn/model/clock-constant-drift.h
Normal file
56
contrib/tsn/model/clock-constant-drift.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#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 */
|
||||
Reference in New Issue
Block a user