53 lines
1.0 KiB
C++
53 lines
1.0 KiB
C++
#ifndef VIRTUALCLOCK_H
|
|
#define VIRTUALCLOCK_H
|
|
|
|
#include "ns3/object.h"
|
|
#include "ns3/nstime.h"
|
|
|
|
#include "ns3/clock.h"
|
|
|
|
namespace ns3
|
|
{
|
|
|
|
class VirtualClock: public Clock
|
|
{
|
|
public:
|
|
/**
|
|
* \brief Get the TypeId
|
|
*
|
|
* \return The TypeId for this class
|
|
*/
|
|
static TypeId GetTypeId();
|
|
|
|
/**
|
|
* \brief Create a VirtualClock
|
|
*/
|
|
VirtualClock();
|
|
|
|
/**
|
|
* Destroy a VirtualClock
|
|
*
|
|
* This is the destructor for the VirtualClock.
|
|
*/
|
|
~VirtualClock() override;
|
|
|
|
// Delete copy constructor and assignment operator to avoid misuse
|
|
VirtualClock& operator=(const VirtualClock&) = delete;
|
|
VirtualClock(const VirtualClock&) = delete;
|
|
|
|
Time GetLocalTime() override;
|
|
Time GetUncorrectedLocalTime() override;
|
|
Time GetTimeAt(Time t) override;
|
|
Time GetDuration(Time t) override;
|
|
void SetRefClock(Ptr<Clock> refClock);
|
|
|
|
protected:
|
|
|
|
private:
|
|
Ptr<Clock> m_refClock = nullptr;
|
|
|
|
};
|
|
|
|
}
|
|
#endif /* VIRTUALCLOCK_H */
|