blob: 262fcd1dcfd9498455e448b50985fd9c12aa5626 [file] [log] [blame]
Junxiao Shifc206962015-01-16 11:12:22 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Eric Newberryf4056d02017-05-26 17:31:53 +00003 * Copyright (c) 2014-2017, Regents of the University of California,
Junxiao Shifc206962015-01-16 11:12:22 -07004 * 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.
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/>.
24 */
25
26#ifndef NFD_DAEMON_TABLE_CS_ENTRY_IMPL_HPP
27#define NFD_DAEMON_TABLE_CS_ENTRY_IMPL_HPP
28
Junxiao Shifc206962015-01-16 11:12:22 -070029#include "cs-entry.hpp"
Junxiao Shifc206962015-01-16 11:12:22 -070030
31namespace nfd {
32namespace cs {
33
34/** \brief an Entry in ContentStore implementation
35 *
36 * An Entry is either a stored Entry which contains a Data packet and related attributes,
37 * or a query Entry which contains a Name that is LessComparable to other stored/query Entry
38 * and is used to lookup a container of entries.
39 *
40 * \note This type is internal to this specific ContentStore implementation.
41 */
42class EntryImpl : public Entry
43{
44public:
45 /** \brief construct Entry for query
46 * \note Name is implicitly convertible to Entry, so that Name can be passed to
47 * lookup functions on a container of Entry
48 */
49 EntryImpl(const Name& name);
50
51 /** \brief construct Entry for storage
52 */
53 EntryImpl(shared_ptr<const Data> data, bool isUnsolicited);
54
Junxiao Shifc206962015-01-16 11:12:22 -070055 void
56 unsetUnsolicited();
57
58 bool
59 operator<(const EntryImpl& other) const;
60
61private:
62 bool
63 isQuery() const;
64
Junxiao Shifc206962015-01-16 11:12:22 -070065private:
66 Name m_queryName;
67};
68
69} // namespace cs
70} // namespace nfd
71
72#endif // NFD_DAEMON_TABLE_CS_ENTRY_IMPL_HPP