NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
time-custom-clock.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_TIME_CUSTOM_CLOCK_HPP
23 #define NDN_TIME_CUSTOM_CLOCK_HPP
24 
25 #include "time.hpp"
26 
27 namespace ndn {
28 namespace time {
29 
36 template<typename BaseClock>
38 {
39 public:
40  virtual ~CustomClock()
41  {
42  }
43 
44  virtual typename BaseClock::time_point
45  getNow() const = 0;
46 
47  virtual std::string
48  getSince() const = 0;
49 
50  virtual boost::posix_time::time_duration
51  toPosixDuration(const typename BaseClock::duration& duration) const = 0;
52 };
53 
56 
63 void
64 setCustomClocks(shared_ptr<CustomSteadyClock> steadyClock = nullptr,
65  shared_ptr<CustomSystemClock> systemClock = nullptr);
66 
67 } // namespace time
68 } // namespace ndn
69 
70 #endif // NDN_TIME_CUSTOM_CLOCK_HPP
Copyright (c) 2011-2015 Regents of the University of California.
virtual BaseClock::time_point getNow() const =0
CustomClock< steady_clock > CustomSteadyClock
virtual std::string getSince() const =0
Class implementing custom system or steady clock behavior.
CustomClock< system_clock > CustomSystemClock
virtual boost::posix_time::time_duration toPosixDuration(const typename BaseClock::duration &duration) const =0
void setCustomClocks(shared_ptr< CustomSteadyClock > steadyClock=nullptr, shared_ptr< CustomSystemClock > systemClock=nullptr)
Set custom system and steady clocks.
Definition: time.cpp:35