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>
37
class
CustomClock
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
54
typedef
CustomClock<system_clock>
CustomSystemClock
;
55
typedef
CustomClock<steady_clock>
CustomSteadyClock
;
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
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::time::CustomClock::~CustomClock
virtual ~CustomClock()
Definition:
time-custom-clock.hpp:40
ndn::time::CustomClock::getNow
virtual BaseClock::time_point getNow() const =0
ndn::time::CustomSteadyClock
CustomClock< steady_clock > CustomSteadyClock
Definition:
time-custom-clock.hpp:55
ndn::time::CustomClock::getSince
virtual std::string getSince() const =0
ndn::time::CustomClock
Class implementing custom system or steady clock behavior.
Definition:
time-custom-clock.hpp:37
ndn::time
Definition:
time-custom-clock.hpp:28
ndn::time::CustomSystemClock
CustomClock< system_clock > CustomSystemClock
Definition:
time-custom-clock.hpp:54
time.hpp
ndn::time::CustomClock::toPosixDuration
virtual boost::posix_time::time_duration toPosixDuration(const typename BaseClock::duration &duration) const =0
ndn::time::setCustomClocks
void setCustomClocks(shared_ptr< CustomSteadyClock > steadyClock=nullptr, shared_ptr< CustomSystemClock > systemClock=nullptr)
Set custom system and steady clocks.
Definition:
time.cpp:35
ndnSIM
ndn-cxx
src
util
time-custom-clock.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12