blob: 7839f50828185039adfa4399324a0a22eb6f7779 [file] [log] [blame]
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (c) 2011-2015 Regents of the University of California.
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -08004 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08005 * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
6 * contributors.
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -08007 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -08008 * ndnSIM is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -080011 *
Alexander Afanasyev60a7b622014-12-20 17:04:07 -080012 * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 **/
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -080019
20#ifndef NDNSIM_UTILS_TIME_HPP
21#define NDNSIM_UTILS_TIME_HPP
22
23#include "ns3/ndnSIM/model/ndn-common.hpp"
24
25#include <ndn-cxx/util/time-custom-clock.hpp>
26
27namespace ns3 {
28namespace ndn {
29namespace time {
30
31class CustomSystemClock : public CustomClock<system_clock> {
32public:
33 system_clock::time_point
34 getNow() const;
35
36 std::string
37 getSince() const;
38
Spyridon Mastorakiscb9be5c2018-02-20 11:22:27 -080039 system_clock::duration
40 toWaitDuration(system_clock::duration d) const;
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -080041};
42
43class CustomSteadyClock : public CustomClock<steady_clock> {
44public:
45 steady_clock::time_point
46 getNow() const;
47
48 std::string
49 getSince() const;
50
Spyridon Mastorakiscb9be5c2018-02-20 11:22:27 -080051 steady_clock::duration
52 toWaitDuration(steady_clock::duration d) const;
Spyridon Mastorakis86edf6f2014-11-14 19:27:18 -080053};
54
55} // namespace time
56} // namespace ndn
57} // namespace ns3
58
59#endif // NDNSIM_UTILS_TIME_HPP