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 | |
Spyridon Mastorakis | 53e922f | 2014-10-17 17:29:26 -0700 | [diff] [blame] | 25 | #include "ns3/ndnSIM/model/ndn-common.hpp" |
| 26 | |
Alexander Afanasyev | 0c39537 | 2014-12-20 15:54:02 -0800 | [diff] [blame] | 27 | #include "ns3/ndnSIM/model/cs/ndn-content-store.hpp" |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 28 | |
| 29 | namespace ns3 { |
| 30 | namespace ndn { |
| 31 | namespace cs { |
| 32 | |
| 33 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 34 | * @ingroup ndn-cs |
| 35 | * @brief Implementation of ContentStore that completely disables caching |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 36 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 37 | class Nocache : public ContentStore { |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 38 | public: |
| 39 | /** |
| 40 | * \brief Interface ID |
| 41 | * |
| 42 | * \return interface ID |
| 43 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 44 | static TypeId |
| 45 | GetTypeId(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * @brief Default constructor |
| 49 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 50 | Nocache(); |
| 51 | |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 52 | /** |
| 53 | * @brief Virtual destructor |
| 54 | */ |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 55 | virtual ~Nocache(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 56 | |
Spyridon Mastorakis | 53e922f | 2014-10-17 17:29:26 -0700 | [diff] [blame] | 57 | virtual shared_ptr<Data> |
| 58 | Lookup(shared_ptr<const Interest> interest); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 59 | |
| 60 | virtual bool |
Spyridon Mastorakis | 53e922f | 2014-10-17 17:29:26 -0700 | [diff] [blame] | 61 | Add(shared_ptr<const Data> data); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 62 | |
| 63 | virtual void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 64 | Print(std::ostream& os) const; |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 65 | |
| 66 | virtual uint32_t |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 67 | GetSize() const; |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 68 | |
| 69 | virtual Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 70 | Begin(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 71 | |
| 72 | virtual Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 73 | End(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 74 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 75 | virtual Ptr<cs::Entry> Next(Ptr<cs::Entry>); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | } // namespace cs |
| 79 | } // namespace ndn |
| 80 | } // namespace ns3 |
| 81 | |
| 82 | #endif // NDN_CONTENT_STORE_NOCACHE_H |