Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (c) 2011-2015 Regents of the University of California. |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 4 | * |
Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 5 | * This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and |
| 6 | * contributors. |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 7 | * |
Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 8 | * ndnSIM is free software: you can redistribute it and/or modify it under the terms |
| 9 | * of the GNU General Public License as published by the Free Software Foundation, |
| 10 | * either version 3 of the License, or (at your option) any later version. |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 11 | * |
Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 12 | * ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 13 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 | * PURPOSE. See the GNU General Public License for more details. |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 15 | * |
Alexander Afanasyev | 60a7b62 | 2014-12-20 17:04:07 -0800 | [diff] [blame] | 16 | * You should have received a copy of the GNU General Public License along with |
| 17 | * ndnSIM, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 18 | **/ |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 19 | |
Alexander Afanasyev | 0c39537 | 2014-12-20 15:54:02 -0800 | [diff] [blame] | 20 | #include "content-store-nocache.hpp" |
| 21 | |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 22 | #include "ns3/log.h" |
| 23 | #include "ns3/packet.h" |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 24 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 25 | NS_LOG_COMPONENT_DEFINE("ndn.cs.Nocache"); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 26 | |
| 27 | namespace ns3 { |
| 28 | namespace ndn { |
| 29 | namespace cs { |
| 30 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 31 | NS_OBJECT_ENSURE_REGISTERED(Nocache); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 32 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 33 | TypeId |
| 34 | Nocache::GetTypeId(void) |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 35 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 36 | static TypeId tid = TypeId("ns3::ndn::cs::Nocache") |
| 37 | .SetGroupName("Ndn") |
| 38 | .SetParent<ContentStore>() |
| 39 | .AddConstructor<Nocache>(); |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 40 | |
| 41 | return tid; |
| 42 | } |
| 43 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 44 | Nocache::Nocache() |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 45 | { |
| 46 | } |
| 47 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 48 | Nocache::~Nocache() |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 49 | { |
| 50 | } |
| 51 | |
Spyridon Mastorakis | 53e922f | 2014-10-17 17:29:26 -0700 | [diff] [blame] | 52 | shared_ptr<Data> |
| 53 | Nocache::Lookup(shared_ptr<const Interest> interest) |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 54 | { |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 55 | this->m_cacheMissesTrace(interest); |
Alexander Afanasyev | b989b12 | 2013-07-10 17:15:46 -0700 | [diff] [blame] | 56 | return 0; |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | bool |
Spyridon Mastorakis | 53e922f | 2014-10-17 17:29:26 -0700 | [diff] [blame] | 60 | Nocache::Add(shared_ptr<const Data> data) |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 61 | { |
| 62 | return false; |
| 63 | } |
| 64 | |
| 65 | void |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 66 | Nocache::Print(std::ostream& os) const |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 67 | { |
| 68 | } |
| 69 | |
| 70 | uint32_t |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 71 | Nocache::GetSize() const |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 72 | { |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 77 | Nocache::Begin() |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 78 | { |
| 79 | return 0; |
| 80 | } |
| 81 | |
| 82 | Ptr<cs::Entry> |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 83 | Nocache::End() |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 84 | { |
| 85 | return 0; |
| 86 | } |
| 87 | |
Alexander Afanasyev | be55cf6 | 2014-12-20 17:51:09 -0800 | [diff] [blame] | 88 | Ptr<cs::Entry> Nocache::Next(Ptr<cs::Entry>) |
Alexander Afanasyev | 8ade0be | 2013-06-04 10:06:06 -0700 | [diff] [blame] | 89 | { |
| 90 | return 0; |
| 91 | } |
| 92 | |
| 93 | } // namespace cs |
| 94 | } // namespace ndn |
| 95 | } // namespace ns3 |