blob: fb6b44fdcf3b0d9698948890b232d46d6a38d740 [file] [log] [blame]
Yingdi Yub20ae812014-08-15 11:20:19 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
Ashlesh Gawande687cf922017-05-30 15:04:16 -05003 * Copyright (c) 2012-2017 University of California, Los Angeles
Yingdi Yub20ae812014-08-15 11:20:19 -07004 *
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
23#ifndef CHRONOSYNC_COMMON_HPP
24#define CHRONOSYNC_COMMON_HPP
25
26#include "config.hpp"
27
28#ifdef _TESTS
Yingdi Yu906c2ea2014-10-31 11:24:50 -070029#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 Yub20ae812014-08-15 11:20:19 -070033#else
Yingdi Yu906c2ea2014-10-31 11:24:50 -070034#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 Yub20ae812014-08-15 11:20:19 -070038#endif
39
40#include <cstddef>
41#include <list>
Yingdi Yub20ae812014-08-15 11:20:19 -070042#include <queue>
Ashlesh Gawande08784d42017-09-06 23:40:21 -050043#include <set>
Yingdi Yub20ae812014-08-15 11:20:19 -070044#include <vector>
Ashlesh Gawande08784d42017-09-06 23:40:21 -050045#include <tuple>
Yingdi Yub20ae812014-08-15 11:20:19 -070046
Yingdi Yub20ae812014-08-15 11:20:19 -070047#include <ndn-cxx/data.hpp>
Ashlesh Gawande08784d42017-09-06 23:40:21 -050048#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>
52#include <ndn-cxx/security/v2/validator.hpp>
53#include <ndn-cxx/security/validator-config.hpp>
54#include <ndn-cxx/util/scheduler.hpp>
55#include <ndn-cxx/util/time.hpp>
Yingdi Yub20ae812014-08-15 11:20:19 -070056
57#include <boost/algorithm/string.hpp>
58#include <boost/asio.hpp>
59#include <boost/assert.hpp>
Yingdi Yud514c172014-08-26 21:49:39 -070060#include <boost/foreach.hpp>
Yingdi Yub20ae812014-08-15 11:20:19 -070061#include <boost/lexical_cast.hpp>
62#include <boost/noncopyable.hpp>
63#include <boost/property_tree/ptree.hpp>
64#include <boost/scoped_ptr.hpp>
Yingdi Yud514c172014-08-26 21:49:39 -070065#include <boost/tuple/tuple.hpp>
Yingdi Yub20ae812014-08-15 11:20:19 -070066
67namespace chronosync {
68
69using std::size_t;
70
71using boost::noncopyable;
72using boost::scoped_ptr;
73
Yingdi Yu9d5679a2015-02-01 00:17:58 -080074using std::bind;
Ashlesh Gawande08784d42017-09-06 23:40:21 -050075using std::const_pointer_cast;
Yingdi Yu9d5679a2015-02-01 00:17:58 -080076using std::cref;
Ashlesh Gawande08784d42017-09-06 23:40:21 -050077using std::dynamic_pointer_cast;
78using std::enable_shared_from_this;
79using std::function;
80using std::make_shared;
81using std::make_tuple;
82using std::ref;
83using std::shared_ptr;
84using std::static_pointer_cast;
85using std::weak_ptr;
Yingdi Yub20ae812014-08-15 11:20:19 -070086
Yingdi Yub20ae812014-08-15 11:20:19 -070087using ndn::Block;
Ashlesh Gawande08784d42017-09-06 23:40:21 -050088using ndn::ConstBufferPtr;
89using ndn::Data;
90using ndn::Exclude;
91using ndn::Interest;
92using ndn::Name;
93using ndn::security::v2::ValidationError;
94using ndn::security::v2::Validator;
Yingdi Yub20ae812014-08-15 11:20:19 -070095
96namespace tlv {
Yingdi Yu906c2ea2014-10-31 11:24:50 -070097using namespace ndn::tlv;
Ashlesh Gawande687cf922017-05-30 15:04:16 -050098} // namespace tlv
Yingdi Yub20ae812014-08-15 11:20:19 -070099
100namespace name = ndn::name;
101namespace time = ndn::time;
Ashlesh Gawande687cf922017-05-30 15:04:16 -0500102namespace security = ndn::security;
Ashlesh Gawande08784d42017-09-06 23:40:21 -0500103namespace encoding = ndn::encoding;
Yingdi Yub20ae812014-08-15 11:20:19 -0700104
105} // namespace chronosync
106
107#endif // CHRONOSYNC_COMMON_HPP