blob: ecd0719cbcd085a2a193e8d935e2457f75e392f9 [file] [log] [blame]
Shuo Chen9c2477f2014-03-13 15:01:06 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Alexander Afanasyevc0e26582017-08-13 21:16:49 -04002/*
Junxiao Shi047a6fb2017-06-08 16:16:05 +00003 * Copyright (c) 2014-2017, Regents of the University of California.
Alexander Afanasyeve1e6f2a2014-04-25 11:28:12 -07004 *
5 * This file is part of NDN repo-ng (Next generation of NDN repository).
6 * See AUTHORS.md for complete list of repo-ng authors and contributors.
7 *
8 * repo-ng 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.
11 *
12 * repo-ng 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 * repo-ng, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Shuo Chen9c2477f2014-03-13 15:01:06 -070018 */
Shuo Chenba793e92014-03-17 17:17:16 -070019
Alexander Afanasyev39d98072014-05-04 12:46:29 -070020#ifndef REPO_COMMON_HPP
21#define REPO_COMMON_HPP
Shuo Chen9c2477f2014-03-13 15:01:06 -070022
Alexander Afanasyeve291caf2014-04-25 11:17:36 -070023#include <ndn-cxx/face.hpp>
Alexander Afanasyev39d98072014-05-04 12:46:29 -070024#include <ndn-cxx/interest.hpp>
25#include <ndn-cxx/name.hpp>
26#include <ndn-cxx/data.hpp>
27#include <ndn-cxx/selectors.hpp>
28#include <ndn-cxx/key-locator.hpp>
Alexander Afanasyevc0e26582017-08-13 21:16:49 -040029#include <ndn-cxx/security/v2/key-chain.hpp>
30#include <ndn-cxx/security/v2/validator.hpp>
31#include <ndn-cxx/security/validator-config.hpp>
Alexander Afanasyeve291caf2014-04-25 11:17:36 -070032#include <ndn-cxx/util/time.hpp>
33#include <ndn-cxx/util/scheduler.hpp>
Alexander Afanasyev39d98072014-05-04 12:46:29 -070034
35#include <boost/utility.hpp>
Shuo Chen9c2477f2014-03-13 15:01:06 -070036#include <boost/random/mersenne_twister.hpp>
37#include <boost/random/uniform_int_distribution.hpp>
Shuo Chen9a43f162014-07-01 13:43:54 +080038#include <boost/random/geometric_distribution.hpp>
Alexander Afanasyev39d98072014-05-04 12:46:29 -070039
Shuo Chen9c2477f2014-03-13 15:01:06 -070040#include <map>
Alexander Afanasyev39d98072014-05-04 12:46:29 -070041#include <string>
42#include <vector>
Shuo Chen9a43f162014-07-01 13:43:54 +080043#include <queue>
44#include <list>
Shuo Chen29c77fe2014-03-18 11:29:41 -070045#include <algorithm>
Shuo Chen9a43f162014-07-01 13:43:54 +080046#include <iostream>
Wentao Shanga8f3c402014-10-30 14:03:27 -070047#include <functional>
48#include <memory>
Shuo Chen9c2477f2014-03-13 15:01:06 -070049
50namespace repo {
Shuo Chenba793e92014-03-17 17:17:16 -070051
Shuo Chen9c2477f2014-03-13 15:01:06 -070052using ndn::Face;
Alexander Afanasyev39d98072014-05-04 12:46:29 -070053using ndn::Block;
Shuo Chen9c2477f2014-03-13 15:01:06 -070054using ndn::Name;
Alexander Afanasyev595b2bd2014-12-14 12:55:36 -080055namespace name = ndn::name;
Shuo Chen9c2477f2014-03-13 15:01:06 -070056using ndn::Interest;
Shuo Chen9c2477f2014-03-13 15:01:06 -070057using ndn::Selectors;
Alexander Afanasyev39d98072014-05-04 12:46:29 -070058using ndn::Exclude;
59using ndn::Data;
60using ndn::KeyLocator;
Shuo Chen29c77fe2014-03-18 11:29:41 -070061using ndn::Scheduler;
Alexander Afanasyevc0e26582017-08-13 21:16:49 -040062using ndn::security::v2::KeyChain;
63using ndn::security::v2::Validator;
64using ndn::security::v2::ValidationError;
65using ndn::security::ValidatorConfig;
Shuo Chenba793e92014-03-17 17:17:16 -070066
Wentao Shanga8f3c402014-10-30 14:03:27 -070067using std::shared_ptr;
68using std::make_shared;
69using std::bind;
70using std::placeholders::_1;
71using std::placeholders::_2;
Alexander Afanasyev39d98072014-05-04 12:46:29 -070072
73using boost::noncopyable;
74
Shuo Chen29c77fe2014-03-18 11:29:41 -070075typedef uint64_t ProcessId;
76typedef uint64_t SegmentNo;
77
Alexander Afanasyev39d98072014-05-04 12:46:29 -070078} // namespace repo
Shuo Chen9c2477f2014-03-13 15:01:06 -070079
Alexander Afanasyev39d98072014-05-04 12:46:29 -070080#endif // REPO_COMMON_HPP