Spyridon Mastorakis | 86edf6f | 2014-11-14 19:27:18 -0800 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2012-2014 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | |
| 19 | #ifndef NDNSIM_UTILS_TIME_HPP |
| 20 | #define NDNSIM_UTILS_TIME_HPP |
| 21 | |
| 22 | #include "ns3/ndnSIM/model/ndn-common.hpp" |
| 23 | |
| 24 | #include <ndn-cxx/util/time-custom-clock.hpp> |
| 25 | |
| 26 | namespace ns3 { |
| 27 | namespace ndn { |
| 28 | namespace time { |
| 29 | |
| 30 | class CustomSystemClock : public CustomClock<system_clock> { |
| 31 | public: |
| 32 | system_clock::time_point |
| 33 | getNow() const; |
| 34 | |
| 35 | std::string |
| 36 | getSince() const; |
| 37 | |
| 38 | boost::posix_time::time_duration |
| 39 | toPosixDuration(const system_clock::duration& duration) const; |
| 40 | }; |
| 41 | |
| 42 | class CustomSteadyClock : public CustomClock<steady_clock> { |
| 43 | public: |
| 44 | steady_clock::time_point |
| 45 | getNow() const; |
| 46 | |
| 47 | std::string |
| 48 | getSince() const; |
| 49 | |
| 50 | boost::posix_time::time_duration |
| 51 | toPosixDuration(const steady_clock::duration& duration) const; |
| 52 | }; |
| 53 | |
| 54 | } // namespace time |
| 55 | } // namespace ndn |
| 56 | } // namespace ns3 |
| 57 | |
| 58 | #endif // NDNSIM_UTILS_TIME_HPP |