NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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 <boost/asio.hpp>
30
#include "
time.hpp
"
31
32
namespace
boost
{
33
namespace
asio {
34
35
template
<>
36
struct
time_traits<
ndn
::
time::steady_clock
>
37
{
38
typedef
ndn::time::steady_clock::TimePoint
time_type
;
39
typedef
ndn::time::steady_clock::Duration
duration_type
;
40
41
static
time_type
42
now
()
43
{
44
return
ndn::time::steady_clock::now
();
45
}
46
47
static
time_type
48
add
(
const
time_type&
time
,
const
duration_type& duration)
49
{
50
return
time + duration;
51
}
52
53
static
duration_type
54
subtract
(
const
time_type& timeLhs,
const
time_type& timeRhs)
55
{
56
return
timeLhs - timeRhs;
57
}
58
59
static
bool
60
less_than
(
const
time_type& timeLhs,
const
time_type& timeRhs)
61
{
62
return
timeLhs < timeRhs;
63
}
64
65
static
boost::posix_time::time_duration
66
to_posix_duration
(
const
duration_type& duration)
67
{
68
return
ndn::time::steady_clock::to_posix_duration(duration);
69
}
70
};
71
72
}
// namespace asio
73
}
// namespace boost
74
75
namespace
ndn
{
76
77
typedef
boost::asio::basic_deadline_timer<time::steady_clock>
monotonic_deadline_timer
;
78
79
}
// namespace ndn
80
81
#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:66
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:38
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:48
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:39
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:54
ndn::monotonic_deadline_timer
boost::asio::basic_deadline_timer< time::steady_clock > monotonic_deadline_timer
Definition:
monotonic_deadline_timer.hpp:77
boost::asio::time_traits< ndn::time::steady_clock >::now
static time_type now()
Definition:
monotonic_deadline_timer.hpp:42
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:60
ndn::time::steady_clock::Duration
duration Duration
Definition:
time.hpp:109
ndnSIM
ndn-cxx
src
util
monotonic_deadline_timer.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11