NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-time.cpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #include "ndn-time.hpp"
21 
22 #include "ns3/simulator.h"
23 
24 namespace ns3 {
25 namespace ndn {
26 namespace time {
27 
28 system_clock::time_point
30 {
31  boost::chrono::nanoseconds ns(Simulator::Now().GetNanoSeconds());
32  return system_clock::time_point(ns);
33 }
34 
35 std::string
37 {
38  return " since start of simulation";
39 }
40 
41 system_clock::duration
42 CustomSystemClock::toWaitDuration(system_clock::duration d) const
43 {
44  BOOST_ASSERT_MSG(false, "Must not be called");
45  return time::microseconds(1);
46 }
47 
49 
50 steady_clock::time_point
52 {
53  boost::chrono::nanoseconds ns(Simulator::Now().GetNanoSeconds());
54  return steady_clock::time_point(ns);
55 }
56 
57 std::string
59 {
60  return " since start of simulation";
61 }
62 
63 steady_clock::duration
64 CustomSteadyClock::toWaitDuration(steady_clock::duration d) const
65 {
66  BOOST_ASSERT_MSG(false, "Must not be called");
67  return time::microseconds(1);
68 }
69 
70 } // namespace time
71 } // namespace ndn
72 } // namespace ns3
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app-link-service.cpp:32
ndn-time.hpp
ns3::ndn::time::CustomSystemClock::getSince
std::string getSince() const
Definition: ndn-time.cpp:36
ndn::time
Definition: time-custom-clock.hpp:28
ns3::ndn::time::CustomSteadyClock::getNow
steady_clock::time_point getNow() const
Definition: ndn-time.cpp:51
ns3::ndn::time::CustomSteadyClock::toWaitDuration
steady_clock::duration toWaitDuration(steady_clock::duration d) const
Definition: ndn-time.cpp:64
ns3::ndn::time::CustomSystemClock::toWaitDuration
system_clock::duration toWaitDuration(system_clock::duration d) const
Definition: ndn-time.cpp:42
ns3::ndn::time::CustomSteadyClock::getSince
std::string getSince() const
Definition: ndn-time.cpp:58
ns3::ndn::time::CustomSystemClock::getNow
system_clock::time_point getNow() const
Definition: ndn-time.cpp:29
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-strategy-choice-helper.hpp:34