Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
Davide Pesavento | 07684bc | 2021-02-07 20:09:28 -0500 | [diff] [blame^] | 3 | * Copyright (c) 2012-2021 University of California, Los Angeles |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 4 | * |
| 5 | * This file is part of ChronoSync, synchronization library for distributed realtime |
| 6 | * applications for NDN. |
| 7 | * |
| 8 | * ChronoSync 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, either |
| 10 | * version 3 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * ChronoSync 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 | * ChronoSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | * |
| 19 | * @author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html> |
| 20 | * @author Yingdi Yu <yingdi@cs.ucla.edu> |
| 21 | */ |
| 22 | |
Davide Pesavento | 07684bc | 2021-02-07 20:09:28 -0500 | [diff] [blame^] | 23 | #ifndef CHRONOSYNC_DETAIL_COMMON_HPP |
| 24 | #define CHRONOSYNC_DETAIL_COMMON_HPP |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 25 | |
Davide Pesavento | 07684bc | 2021-02-07 20:09:28 -0500 | [diff] [blame^] | 26 | #include "detail/config.hpp" |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 27 | |
Davide Pesavento | 07684bc | 2021-02-07 20:09:28 -0500 | [diff] [blame^] | 28 | #ifdef CHRONOSYNC_WITH_TESTS |
Yingdi Yu | 906c2ea | 2014-10-31 11:24:50 -0700 | [diff] [blame] | 29 | #define CHRONOSYNC_VIRTUAL_WITH_TESTS virtual |
| 30 | #define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED public |
| 31 | #define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE public |
| 32 | #define CHRONOSYNC_PROTECTED_WITH_TESTS_ELSE_PRIVATE protected |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 33 | #else |
Yingdi Yu | 906c2ea | 2014-10-31 11:24:50 -0700 | [diff] [blame] | 34 | #define CHRONOSYNC_VIRTUAL_WITH_TESTS |
| 35 | #define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED protected |
| 36 | #define CHRONOSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE private |
| 37 | #define CHRONOSYNC_PROTECTED_WITH_TESTS_ELSE_PRIVATE private |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 38 | #endif |
| 39 | |
| 40 | #include <cstddef> |
| 41 | #include <list> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 42 | #include <queue> |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 43 | #include <set> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 44 | #include <vector> |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 45 | #include <tuple> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 46 | |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 47 | #include <ndn-cxx/data.hpp> |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 48 | #include <ndn-cxx/face.hpp> |
| 49 | #include <ndn-cxx/interest.hpp> |
| 50 | #include <ndn-cxx/security/key-chain.hpp> |
| 51 | #include <ndn-cxx/security/signing-helpers.hpp> |
Alexander Afanasyev | cc6f67c | 2020-06-03 14:00:32 -0400 | [diff] [blame] | 52 | #include <ndn-cxx/security/validator.hpp> |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 53 | #include <ndn-cxx/security/validator-config.hpp> |
| 54 | #include <ndn-cxx/util/scheduler.hpp> |
| 55 | #include <ndn-cxx/util/time.hpp> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 56 | |
| 57 | #include <boost/algorithm/string.hpp> |
| 58 | #include <boost/asio.hpp> |
| 59 | #include <boost/assert.hpp> |
Davide Pesavento | 5f408ae | 2020-07-15 21:17:04 -0400 | [diff] [blame] | 60 | #include <boost/core/noncopyable.hpp> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 61 | #include <boost/lexical_cast.hpp> |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 62 | |
| 63 | namespace chronosync { |
| 64 | |
| 65 | using std::size_t; |
| 66 | |
| 67 | using boost::noncopyable; |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 68 | |
Yingdi Yu | 9d5679a | 2015-02-01 00:17:58 -0800 | [diff] [blame] | 69 | using std::bind; |
Yingdi Yu | 9d5679a | 2015-02-01 00:17:58 -0800 | [diff] [blame] | 70 | using std::cref; |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 71 | using std::function; |
| 72 | using std::make_shared; |
| 73 | using std::make_tuple; |
| 74 | using std::ref; |
| 75 | using std::shared_ptr; |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 76 | |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 77 | using ndn::Block; |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 78 | using ndn::ConstBufferPtr; |
| 79 | using ndn::Data; |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 80 | using ndn::Interest; |
| 81 | using ndn::Name; |
Alexander Afanasyev | cc6f67c | 2020-06-03 14:00:32 -0400 | [diff] [blame] | 82 | using ndn::security::ValidationError; |
| 83 | using ndn::security::Validator; |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 84 | |
| 85 | namespace tlv { |
Yingdi Yu | 906c2ea | 2014-10-31 11:24:50 -0700 | [diff] [blame] | 86 | using namespace ndn::tlv; |
Ashlesh Gawande | 687cf92 | 2017-05-30 15:04:16 -0500 | [diff] [blame] | 87 | } // namespace tlv |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 88 | |
| 89 | namespace name = ndn::name; |
| 90 | namespace time = ndn::time; |
Ashlesh Gawande | 687cf92 | 2017-05-30 15:04:16 -0500 | [diff] [blame] | 91 | namespace security = ndn::security; |
Ashlesh Gawande | 08784d4 | 2017-09-06 23:40:21 -0500 | [diff] [blame] | 92 | namespace encoding = ndn::encoding; |
Yingdi Yu | b20ae81 | 2014-08-15 11:20:19 -0700 | [diff] [blame] | 93 | |
| 94 | } // namespace chronosync |
| 95 | |
Davide Pesavento | 07684bc | 2021-02-07 20:09:28 -0500 | [diff] [blame^] | 96 | #endif // CHRONOSYNC_DETAIL_COMMON_HPP |