blob: 903c47bbb7fbfc6b91447846aed319739e2ebbb9 [file] [log] [blame]
Yingdi Yu77627ab2015-07-21 16:13:49 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Yingdi Yu0a312e52015-07-22 13:14:53 -07003 * Copyright (c) 2014-2015, Regents of the University of California.
Yingdi Yu77627ab2015-07-21 16:13:49 -07004 *
Yingdi Yu0a312e52015-07-22 13:14:53 -07005 * This file is part of ndn-tools (Named Data Networking Essential Tools).
6 * See AUTHORS.md for complete list of ndn-tools authors and contributors.
Yingdi Yu77627ab2015-07-21 16:13:49 -07007 *
Yingdi Yu0a312e52015-07-22 13:14:53 -07008 * ndn-tools 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.
Yingdi Yu77627ab2015-07-21 16:13:49 -070011 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070012 * ndn-tools 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.
Yingdi Yu77627ab2015-07-21 16:13:49 -070015 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070016 * You should have received a copy of the GNU General Public License along with
17 * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
Yingdi Yu77627ab2015-07-21 16:13:49 -070018 *
Yingdi Yu0a312e52015-07-22 13:14:53 -070019 * @author Yingdi Yu <yingdi@cs.ucla.edu>
Yingdi Yu77627ab2015-07-21 16:13:49 -070020 */
21
Yingdi Yu0a312e52015-07-22 13:14:53 -070022#ifndef NDN_TOOLS_PIB_LIST_QUERY_PROCESSOR_HPP
23#define NDN_TOOLS_PIB_LIST_QUERY_PROCESSOR_HPP
Yingdi Yu77627ab2015-07-21 16:13:49 -070024
25#include "pib-db.hpp"
26#include "encoding/list-param.hpp"
27#include <ndn-cxx/interest.hpp>
28#include <utility>
29
30namespace ndn {
31namespace pib {
32
33class ListQueryProcessor : noncopyable
34{
35public:
36 class Error : public std::runtime_error
37 {
38 public:
39 explicit
40 Error(const std::string& what)
41 : std::runtime_error(what)
42 {
43 }
44 };
45
46 /**
47 * @brief Constructor
48 *
49 * @param db The pib database.
50 */
51 explicit
52 ListQueryProcessor(PibDb& db);
53
54 std::pair<bool, Block>
55 operator()(const Interest& interest);
56
57private:
58 static const size_t LIST_QUERY_LENGTH;
59
60 const PibDb& m_db;
61};
62
63} // namespace pib
64} // namespace ndn
65
Yingdi Yu0a312e52015-07-22 13:14:53 -070066#endif // NDN_TOOLS_PIB_LIST_QUERY_PROCESSOR_HPP