Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Junxiao Shi | 5dd26c3 | 2014-07-20 23:15:14 -0700 | [diff] [blame] | 3 | * Copyright (c) 2014, Regents of the University of California, |
| 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis |
Alexander Afanasyev | 9bcbc7c | 2014-04-06 19:37:37 -0700 | [diff] [blame] | 10 | * |
| 11 | * This file is part of NFD (Named Data Networking Forwarding Daemon). |
| 12 | * See AUTHORS.md for complete list of NFD authors and contributors. |
| 13 | * |
| 14 | * NFD is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
Junxiao Shi | 5dd26c3 | 2014-07-20 23:15:14 -0700 | [diff] [blame] | 24 | */ |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 25 | |
| 26 | #ifndef NFD_COMMON_HPP |
| 27 | #define NFD_COMMON_HPP |
| 28 | |
Junxiao Shi | 61c5ef3 | 2014-01-24 20:59:30 -0700 | [diff] [blame] | 29 | #include "config.hpp" |
| 30 | |
Junxiao Shi | 8888449 | 2014-02-15 15:57:43 -0700 | [diff] [blame] | 31 | #ifdef WITH_TESTS |
| 32 | #define VIRTUAL_WITH_TESTS virtual |
| 33 | #define PUBLIC_WITH_TESTS_ELSE_PROTECTED public |
| 34 | #define PUBLIC_WITH_TESTS_ELSE_PRIVATE public |
| 35 | #define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected |
| 36 | #else |
| 37 | #define VIRTUAL_WITH_TESTS |
| 38 | #define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected |
| 39 | #define PUBLIC_WITH_TESTS_ELSE_PRIVATE private |
| 40 | #define PROTECTED_WITH_TESTS_ELSE_PRIVATE private |
| 41 | #endif |
| 42 | |
Junxiao Shi | 5dd26c3 | 2014-07-20 23:15:14 -0700 | [diff] [blame] | 43 | #include <cstddef> |
Alexander Afanasyev | 8552a38 | 2014-05-15 20:13:42 -0700 | [diff] [blame] | 44 | #include <list> |
| 45 | #include <set> |
Junxiao Shi | 651b75e | 2014-07-17 20:15:09 -0700 | [diff] [blame] | 46 | #include <queue> |
Alexander Afanasyev | 8552a38 | 2014-05-15 20:13:42 -0700 | [diff] [blame] | 47 | #include <vector> |
| 48 | |
Alexander Afanasyev | 4a77136 | 2014-04-24 21:29:33 -0700 | [diff] [blame] | 49 | #include <ndn-cxx/common.hpp> |
| 50 | #include <ndn-cxx/interest.hpp> |
| 51 | #include <ndn-cxx/data.hpp> |
Junxiao Shi | cf1e6e7 | 2014-11-02 21:38:22 -0700 | [diff] [blame] | 52 | #include <ndn-cxx/util/event-emitter.hpp> |
Junxiao Shi | 3ffe66d | 2014-11-06 15:37:59 -0700 | [diff] [blame] | 53 | #include <ndn-cxx/util/ethernet.hpp> |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 54 | |
Alexander Afanasyev | 8552a38 | 2014-05-15 20:13:42 -0700 | [diff] [blame] | 55 | #include <boost/algorithm/string.hpp> |
| 56 | #include <boost/asio.hpp> |
Alexander Afanasyev | 920af2f | 2014-01-25 22:56:11 -0800 | [diff] [blame] | 57 | #include <boost/assert.hpp> |
Steve DiBenedetto | bf6a93d | 2014-03-21 14:03:02 -0600 | [diff] [blame] | 58 | #include <boost/lexical_cast.hpp> |
Davide Pesavento | 52a18f9 | 2014-04-10 00:55:01 +0200 | [diff] [blame] | 59 | #include <boost/noncopyable.hpp> |
Alexander Afanasyev | 8552a38 | 2014-05-15 20:13:42 -0700 | [diff] [blame] | 60 | #include <boost/property_tree/ptree.hpp> |
Davide Pesavento | 52a18f9 | 2014-04-10 00:55:01 +0200 | [diff] [blame] | 61 | #include <boost/scoped_ptr.hpp> |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 62 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 63 | namespace nfd { |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 64 | |
Junxiao Shi | 5dd26c3 | 2014-07-20 23:15:14 -0700 | [diff] [blame] | 65 | using std::size_t; |
| 66 | |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 67 | using boost::noncopyable; |
Davide Pesavento | 52a18f9 | 2014-04-10 00:55:01 +0200 | [diff] [blame] | 68 | using boost::scoped_ptr; |
| 69 | |
Davide Pesavento | ab1e8f2 | 2014-10-21 22:45:33 +0200 | [diff] [blame] | 70 | using std::shared_ptr; |
| 71 | using std::unique_ptr; |
| 72 | using std::weak_ptr; |
| 73 | using std::bad_weak_ptr; |
| 74 | using std::make_shared; |
| 75 | using std::enable_shared_from_this; |
| 76 | |
| 77 | using std::static_pointer_cast; |
| 78 | using std::dynamic_pointer_cast; |
| 79 | using std::const_pointer_cast; |
| 80 | |
| 81 | using std::function; |
| 82 | using std::bind; |
| 83 | using std::ref; |
| 84 | using std::cref; |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 85 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 86 | using ndn::Interest; |
| 87 | using ndn::Data; |
| 88 | using ndn::Name; |
| 89 | using ndn::Exclude; |
| 90 | using ndn::Block; |
Junxiao Shi | cf1e6e7 | 2014-11-02 21:38:22 -0700 | [diff] [blame] | 91 | using ndn::util::EventEmitter; |
Davide Pesavento | 52a18f9 | 2014-04-10 00:55:01 +0200 | [diff] [blame] | 92 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 93 | namespace tlv { |
Junxiao Shi | 67f11ac | 2014-10-19 09:29:13 -0700 | [diff] [blame] | 94 | // Don't write "namespace tlv = ndn::tlv", because NFD can add other members into this namespace. |
| 95 | using namespace ndn::tlv; |
| 96 | } // namespace tlv |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 97 | |
Davide Pesavento | 52a18f9 | 2014-04-10 00:55:01 +0200 | [diff] [blame] | 98 | namespace name = ndn::name; |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 99 | namespace time = ndn::time; |
Junxiao Shi | 3ffe66d | 2014-11-06 15:37:59 -0700 | [diff] [blame] | 100 | namespace ethernet = ndn::util::ethernet; |
Alexander Afanasyev | eb3197f | 2014-03-17 19:28:18 -0700 | [diff] [blame] | 101 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 102 | } // namespace nfd |
Alexander Afanasyev | b927a3a | 2014-01-24 10:41:47 -0800 | [diff] [blame] | 103 | |
| 104 | #endif // NFD_COMMON_HPP |