Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Alexander Afanasyev |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation; |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | * |
| 19 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 20 | */ |
| 21 | |
| 22 | #ifndef NDN_CONTENT_STORE_NOCACHE_H |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 23 | #define NDN_CONTENT_STORE_NOCACHE_H |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 24 | |
Alexander Afanasyev | 0c39537 | 2014-12-20 15:54:02 -0800 | [diff] [blame] | 25 | #include "ns3/ndnSIM/model/cs/ndn-content-store.hpp" |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ns3 { |
| 28 | namespace ndn { |
| 29 | namespace cs { |
| 30 | |
| 31 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 32 | * @ingroup ndn-cs |
| 33 | * @brief Implementation of ContentStore that completely disables caching |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 34 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 35 | class Nocache : public ContentStore { |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 36 | public: |
| 37 | /** |
| 38 | * \brief Interface ID |
| 39 | * |
| 40 | * \return interface ID |
| 41 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 42 | static TypeId |
| 43 | GetTypeId(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * @brief Default constructor |
| 47 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 48 | Nocache(); |
| 49 | |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 50 | /** |
| 51 | * @brief Virtual destructor |
| 52 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 53 | virtual ~Nocache(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 54 | |
Alexander Afanasyev | 772f51b | 2013-08-01 18:53:25 -0700 | [diff] [blame] | 55 | virtual Ptr<Data> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 56 | Lookup(Ptr<const Interest> interest); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 57 | |
| 58 | virtual bool |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 59 | Add(Ptr<const Data> data); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 60 | |
| 61 | virtual void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 62 | Print(std::ostream& os) const; |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 63 | |
| 64 | virtual uint32_t |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 65 | GetSize() const; |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 66 | |
| 67 | virtual Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 68 | Begin(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 69 | |
| 70 | virtual Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 71 | End(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 72 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 73 | virtual Ptr<cs::Entry> Next(Ptr<cs::Entry>); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 74 | }; |
| 75 | |
| 76 | } // namespace cs |
| 77 | } // namespace ndn |
| 78 | } // namespace ns3 |
| 79 | |
| 80 | #endif // NDN_CONTENT_STORE_NOCACHE_H |