NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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
41
~CustomClock
() =
default
;
42
43
virtual
typename
BaseClock::time_point
44
getNow
()
const
= 0;
45
46
virtual
std::string
47
getSince
()
const
= 0;
48
49
virtual
boost::posix_time::time_duration
50
toPosixDuration
(
const
typename
BaseClock::duration& duration)
const
= 0;
51
};
52
53
typedef
CustomClock<system_clock>
CustomSystemClock
;
54
typedef
CustomClock<steady_clock>
CustomSteadyClock
;
55
62
void
63
setCustomClocks
(shared_ptr<CustomSteadyClock> steadyClock =
nullptr
,
64
shared_ptr<CustomSystemClock> systemClock =
nullptr
);
65
66
}
// namespace time
67
}
// namespace ndn
68
69
#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::getNow
virtual BaseClock::time_point getNow() const =0
ndn::time::CustomSteadyClock
CustomClock< steady_clock > CustomSteadyClock
Definition:
time-custom-clock.hpp:54
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:53
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
ndn::time::CustomClock::~CustomClock
virtual ~CustomClock()=default
ndnSIM
ndn-cxx
src
util
time-custom-clock.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13