NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
monotonic_deadline_timer.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NDN_UTIL_MONOTONIC_DEADLINE_TIMER_HPP
27
#define NDN_UTIL_MONOTONIC_DEADLINE_TIMER_HPP
28
29
#include "
time.hpp
"
30
31
#include <boost/asio/basic_deadline_timer.hpp>
32
33
namespace
boost
{
34
namespace
asio {
35
36
template
<>
37
struct
time_traits<
ndn
::
time::steady_clock
>
38
{
39
typedef
ndn::time::steady_clock::TimePoint
time_type
;
40
typedef
ndn::time::steady_clock::Duration
duration_type
;
41
42
static
time_type
43
now
()
44
{
45
return
ndn::time::steady_clock::now
();
46
}
47
48
static
time_type
49
add
(
const
time_type&
time
,
const
duration_type& duration)
50
{
51
return
time + duration;
52
}
53
54
static
duration_type
55
subtract
(
const
time_type& timeLhs,
const
time_type& timeRhs)
56
{
57
return
timeLhs - timeRhs;
58
}
59
60
static
bool
61
less_than
(
const
time_type& timeLhs,
const
time_type& timeRhs)
62
{
63
return
timeLhs < timeRhs;
64
}
65
66
static
boost::posix_time::time_duration
67
to_posix_duration
(
const
duration_type& duration)
68
{
69
return
ndn::time::steady_clock::to_posix_duration(duration);
70
}
71
};
72
73
}
// namespace asio
74
}
// namespace boost
75
76
namespace
ndn
{
77
78
typedef
boost::asio::basic_deadline_timer<time::steady_clock>
monotonic_deadline_timer
;
79
80
}
// namespace ndn
81
82
#endif // NDN_UTIL_MONOTONIC_DEADLINE_TIMER_HPP
ndn::time::steady_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:108
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
boost
Copyright (c) 2013-2015 Regents of the University of California.
Definition:
ndn-content-store.hpp:209
boost::asio::time_traits< ndn::time::steady_clock >::to_posix_duration
static boost::posix_time::time_duration to_posix_duration(const duration_type &duration)
Definition:
monotonic_deadline_timer.hpp:67
ndn::time::steady_clock::now
static time_point now() noexcept
Definition:
time.cpp:79
boost::asio::time_traits< ndn::time::steady_clock >::time_type
ndn::time::steady_clock::TimePoint time_type
Definition:
monotonic_deadline_timer.hpp:39
boost::asio::time_traits< ndn::time::steady_clock >::add
static time_type add(const time_type &time, const duration_type &duration)
Definition:
monotonic_deadline_timer.hpp:49
ndn::time::steady_clock
Steady clock.
Definition:
time.hpp:99
ndn::time
Definition:
time-custom-clock.hpp:28
boost::asio::time_traits< ndn::time::steady_clock >::duration_type
ndn::time::steady_clock::Duration duration_type
Definition:
monotonic_deadline_timer.hpp:40
time.hpp
boost::asio::time_traits< ndn::time::steady_clock >::subtract
static duration_type subtract(const time_type &timeLhs, const time_type &timeRhs)
Definition:
monotonic_deadline_timer.hpp:55
ndn::monotonic_deadline_timer
boost::asio::basic_deadline_timer< time::steady_clock > monotonic_deadline_timer
Definition:
monotonic_deadline_timer.hpp:78
boost::asio::time_traits< ndn::time::steady_clock >::now
static time_type now()
Definition:
monotonic_deadline_timer.hpp:43
boost::asio::time_traits< ndn::time::steady_clock >::less_than
static bool less_than(const time_type &timeLhs, const time_type &timeRhs)
Definition:
monotonic_deadline_timer.hpp:61
ndn::time::steady_clock::Duration
duration Duration
Definition:
time.hpp:109
ndnSIM
ndn-cxx
src
util
monotonic_deadline_timer.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12