Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Junxiao Shi | c542f63 | 2017-07-18 14:20:32 +0000 | [diff] [blame^] | 2 | /* |
| 3 | * Copyright (c) 2013-2017 Regents of the University of California. |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 4 | * |
| 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 Shi | c542f63 | 2017-07-18 14:20:32 +0000 | [diff] [blame^] | 22 | #ifndef NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP |
| 23 | #define NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 24 | |
| 25 | #include "in-memory-storage.hpp" |
| 26 | |
| 27 | namespace ndn { |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 28 | |
| 29 | /** @brief Provides application cache with persistent storage, of which no replacement policy will |
Junxiao Shi | c542f63 | 2017-07-18 14:20:32 +0000 | [diff] [blame^] | 30 | * be employed. Entries will only be deleted by explicit application control. |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 31 | */ |
| 32 | class InMemoryStoragePersistent : public InMemoryStorage |
| 33 | { |
| 34 | public: |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 35 | InMemoryStoragePersistent(); |
| 36 | |
Yingdi Yu | 404eafd | 2016-03-06 14:54:25 -0800 | [diff] [blame] | 37 | explicit |
| 38 | InMemoryStoragePersistent(boost::asio::io_service& ioService); |
| 39 | |
Junxiao Shi | 9984850 | 2014-10-13 19:22:22 -0700 | [diff] [blame] | 40 | NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED: |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 41 | /** @brief Do nothing. |
| 42 | * |
| 43 | * This storage is persistent, and does not support eviction. |
| 44 | * |
| 45 | * @return false |
| 46 | */ |
Davide Pesavento | 57c07df | 2016-12-11 18:41:45 -0500 | [diff] [blame] | 47 | bool |
Davide Pesavento | aeeb3fc | 2016-08-14 03:40:02 +0200 | [diff] [blame] | 48 | evictItem() override; |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 49 | }; |
| 50 | |
Jiewen Tan | 9913596 | 2014-09-20 02:18:53 -0700 | [diff] [blame] | 51 | } // namespace ndn |
| 52 | |
Junxiao Shi | c542f63 | 2017-07-18 14:20:32 +0000 | [diff] [blame^] | 53 | #endif // NDN_IMS_IN_MEMORY_STORAGE_PERSISTENT_HPP |