NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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 boost::posix_time::time_duration
42 CustomSystemClock::toPosixDuration(const system_clock::duration& duration) const
43 {
44  BOOST_ASSERT_MSG(false, "Must not be called");
45  return boost::posix_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 boost::posix_time::time_duration
64 CustomSteadyClock::toPosixDuration(const steady_clock::duration& duration) const
65 {
66  BOOST_ASSERT_MSG(false, "Must not be called");
67  return boost::posix_time::microseconds(1);
68 }
69 
70 } // namespace time
71 } // namespace ndn
72 } // namespace ns3
Copyright (c) 2011-2015 Regents of the University of California.
std::string getSince() const
Definition: ndn-time.cpp:36
boost::posix_time::time_duration toPosixDuration(const system_clock::duration &duration) const
Definition: ndn-time.cpp:42
system_clock::time_point getNow() const
Definition: ndn-time.cpp:29
steady_clock::time_point getNow() const
Definition: ndn-time.cpp:51
Copyright (c) 2011-2015 Regents of the University of California.
boost::posix_time::time_duration toPosixDuration(const steady_clock::duration &duration) const
Definition: ndn-time.cpp:64
std::string getSince() const
Definition: ndn-time.cpp:58