blob: 5920ef36e2ac773daefc876f44d7689d2e3b55e3 [file] [log] [blame]
Jiewen Tan99135962014-09-20 02:18:53 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Junxiao Shic542f632017-07-18 14:20:32 +00002/*
3 * Copyright (c) 2013-2017 Regents of the University of California.
Jiewen Tan99135962014-09-20 02:18:53 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20 */
21
Junxiao Shic542f632017-07-18 14:20:32 +000022#ifndef NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP
23#define NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP
Jiewen Tan99135962014-09-20 02:18:53 -070024
25#include "in-memory-storage.hpp"
26
27namespace ndn {
Jiewen Tan99135962014-09-20 02:18:53 -070028
29/** @brief Provides application cache with persistent storage, of which no replacement policy will
Junxiao Shic542f632017-07-18 14:20:32 +000030 * be employed. Entries will only be deleted by explicit application control.
Jiewen Tan99135962014-09-20 02:18:53 -070031 */
32class InMemoryStoragePersistent : public InMemoryStorage
33{
34public:
Jiewen Tan99135962014-09-20 02:18:53 -070035 InMemoryStoragePersistent();
36
Yingdi Yu404eafd2016-03-06 14:54:25 -080037 explicit
38 InMemoryStoragePersistent(boost::asio::io_service& ioService);
39
Junxiao Shi99848502014-10-13 19:22:22 -070040NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED:
Jiewen Tan99135962014-09-20 02:18:53 -070041 /** @brief Do nothing.
42 *
43 * This storage is persistent, and does not support eviction.
44 *
45 * @return false
46 */
Davide Pesavento57c07df2016-12-11 18:41:45 -050047 bool
Davide Pesaventoaeeb3fc2016-08-14 03:40:02 +020048 evictItem() override;
Jiewen Tan99135962014-09-20 02:18:53 -070049};
50
Jiewen Tan99135962014-09-20 02:18:53 -070051} // namespace ndn
52
Junxiao Shic542f632017-07-18 14:20:32 +000053#endif // NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP