blob: bb8e42a9663a62162c15cc987a452d822e607ece [file] [log] [blame]
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070021#include "ndn-pit-impl.h"
Alexander Afanasyeve3d126f2012-07-16 17:07:31 -070022
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070023#include "ns3/ndn-interest-header.h"
24#include "ns3/ndn-content-object-header.h"
25#include "ns3/ndn-forwarding-strategy.h"
Alexander Afanasyeve3d126f2012-07-16 17:07:31 -070026
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070027#include "../../utils/empty-policy.h"
28#include "../../utils/persistent-policy.h"
29#include "../../utils/random-policy.h"
30#include "../../utils/lru-policy.h"
31
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -070032#include "ns3/log.h"
33#include "ns3/string.h"
34#include "ns3/uinteger.h"
35#include "ns3/simulator.h"
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -070036
37#include <boost/lambda/bind.hpp>
38#include <boost/lambda/lambda.hpp>
39
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070040NS_LOG_COMPONENT_DEFINE ("ndn.pit.PitImpl");
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -070041
42using namespace boost::tuples;
43using namespace boost;
44namespace ll = boost::lambda;
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070045
46#define NS_OBJECT_ENSURE_REGISTERED_TEMPL(type, templ) \
47 static struct X ## type ## templ ## RegistrationClass \
48 { \
49 X ## type ## templ ## RegistrationClass () { \
50 ns3::TypeId tid = type<templ>::GetTypeId (); \
51 tid.GetParent (); \
52 } \
53 } x_ ## type ## templ ## RegistrationVariable
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -070054
55namespace ns3 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070056namespace ndn {
57namespace pit {
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -070058
Alexander Afanasyeve77db792012-08-09 11:10:58 -070059using namespace ndnSIM;
60
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070061template<>
62TypeId
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070063PitImpl<persistent_policy_traits>::GetTypeId ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070064{
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070065 static TypeId tid = TypeId ("ns3::ndn::pit::Persistent")
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070066 .SetGroupName ("Ndn")
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070067 .SetParent<Pit> ()
68 .AddConstructor< PitImpl< persistent_policy_traits > > ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070069 .AddAttribute ("MaxSize",
70 "Set maximum number of entries in PIT. If 0, limit is not enforced",
71 StringValue ("0"),
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070072 MakeUintegerAccessor (&PitImpl< persistent_policy_traits >::GetMaxSize,
73 &PitImpl< persistent_policy_traits >::SetMaxSize),
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070074 MakeUintegerChecker<uint32_t> ())
75 ;
76
Alexander Afanasyev0a0dc392012-07-27 13:41:49 -070077 return tid;
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070078}
79
80template<>
81TypeId
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070082PitImpl<random_policy_traits>::GetTypeId ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070083{
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070084 static TypeId tid = TypeId ("ns3::ndn::pit::Random")
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070085 .SetGroupName ("Ndn")
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070086 .SetParent<Pit> ()
87 .AddConstructor< PitImpl< random_policy_traits > > ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070088 .AddAttribute ("MaxSize",
89 "Set maximum number of entries in PIT. If 0, limit is not enforced",
90 StringValue ("0"),
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070091 MakeUintegerAccessor (&PitImpl< random_policy_traits >::GetMaxSize,
92 &PitImpl< random_policy_traits >::SetMaxSize),
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070093 MakeUintegerChecker<uint32_t> ())
94 ;
95
Alexander Afanasyev0a0dc392012-07-27 13:41:49 -070096 return tid;
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -070097}
98
99template<>
100TypeId
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700101PitImpl<lru_policy_traits>::GetTypeId ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700102{
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700103 static TypeId tid = TypeId ("ns3::ndn::pit::Lru")
Alexander Afanasyev4aac5572012-08-09 10:49:55 -0700104 .SetGroupName ("Ndn")
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700105 .SetParent<Pit> ()
106 .AddConstructor< PitImpl< lru_policy_traits > > ()
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700107 .AddAttribute ("MaxSize",
108 "Set maximum number of entries in PIT. If 0, limit is not enforced",
109 StringValue ("0"),
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700110 MakeUintegerAccessor (&PitImpl< lru_policy_traits >::GetMaxSize,
111 &PitImpl< lru_policy_traits >::SetMaxSize),
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700112 MakeUintegerChecker<uint32_t> ())
113 ;
114
Alexander Afanasyev0a0dc392012-07-27 13:41:49 -0700115 return tid;
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700116}
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700117
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700118template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700119PitImpl<Policy>::PitImpl ()
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700120{
121}
122
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700123template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700124PitImpl<Policy>::~PitImpl ()
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700125{
126}
127
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700128template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700129uint32_t
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700130PitImpl<Policy>::GetMaxSize () const
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700131{
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700132 return super::getPolicy ().get_max_size ();
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700133}
134
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700135template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700136void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700137PitImpl<Policy>::SetMaxSize (uint32_t maxSize)
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700138{
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700139 super::getPolicy ().set_max_size (maxSize);
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700140}
141
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700142template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700143void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700144PitImpl<Policy>::NotifyNewAggregate ()
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700145{
146 if (m_fib == 0)
147 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700148 m_fib = GetObject<Fib> ();
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700149 }
Alexander Afanasyevf249a192012-07-18 16:52:51 -0700150 if (m_forwardingStrategy == 0)
151 {
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700152 m_forwardingStrategy = GetObject<ForwardingStrategy> ();
Alexander Afanasyevf249a192012-07-18 16:52:51 -0700153 }
154
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700155 Pit::NotifyNewAggregate ();
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700156}
157
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700158template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700159void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700160PitImpl<Policy>::DoDispose ()
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700161{
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700162 super::clear ();
Alexander Afanasyevf249a192012-07-18 16:52:51 -0700163
164 m_forwardingStrategy = 0;
165 m_fib = 0;
166
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700167 Pit::DoDispose ();
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700168}
169
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700170template<class Policy>
171void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700172PitImpl<Policy>::RescheduleCleaning ()
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700173{
174 m_cleanEvent.Cancel ();
175 if (i_time.empty ())
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700176 {
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700177 // NS_LOG_DEBUG ("No items in PIT");
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700178 return;
179 }
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700180
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700181 Time nextEvent = i_time.begin ()->GetExpireTime () - Simulator::Now ();
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700182 if (nextEvent <= 0) nextEvent = Seconds (0);
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700183
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700184 // NS_LOG_DEBUG ("Schedule next cleaning in " <<
185 // nextEvent.ToDouble (Time::S) << "s (at " <<
186 // i_time.begin ()->GetExpireTime () << "s abs time");
187
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700188 m_cleanEvent = Simulator::Schedule (nextEvent,
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700189 &PitImpl<Policy>::CleanExpired, this);
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700190}
191
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700192template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700193void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700194PitImpl<Policy>::CleanExpired ()
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700195{
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700196 NS_LOG_LOGIC ("Cleaning PIT. Total: " << i_time.size ());
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700197 Time now = Simulator::Now ();
198
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700199 // uint32_t count = 0;
200 while (!i_time.empty ())
201 {
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700202 typename time_index::iterator entry = i_time.begin ();
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700203 if (entry->GetExpireTime () <= now) // is the record stale?
204 {
Alexander Afanasyevf249a192012-07-18 16:52:51 -0700205 m_forwardingStrategy->WillErasePendingInterest (entry->to_iterator ()->payload ());
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700206 super::erase (entry->to_iterator ());
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700207 // count ++;
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700208 }
209 else
210 break; // nothing else to do. All later records will not be stale
211 }
212
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700213 if (super::getPolicy ().size ())
214 {
215 NS_LOG_DEBUG ("Size: " << super::getPolicy ().size ());
Alexander Afanasyev6b51b082012-07-27 16:28:34 -0700216 NS_LOG_DEBUG ("i_time size: " << i_time.size ());
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700217 }
Alexander Afanasyev413c7f12012-07-10 17:35:16 -0700218 RescheduleCleaning ();
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700219}
220
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700221template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700222Ptr<Entry>
223PitImpl<Policy>::Lookup (const ContentObjectHeader &header)
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700224{
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700225 /// @todo use predicate to search with exclude filters
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700226 typename super::iterator item = super::longest_prefix_match (header.GetName ());
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700227
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700228 if (item == super::end ())
229 return 0;
230 else
231 return item->payload (); // which could also be 0
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700232}
233
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700234template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700235Ptr<Entry>
236PitImpl<Policy>::Lookup (const InterestHeader &header)
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700237{
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700238 // NS_LOG_FUNCTION (header.GetName ());
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700239 NS_ASSERT_MSG (m_fib != 0, "FIB should be set");
Alexander Afanasyevf249a192012-07-18 16:52:51 -0700240 NS_ASSERT_MSG (m_forwardingStrategy != 0, "Forwarding strategy should be set");
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700241
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700242 typename super::iterator foundItem, lastItem;
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700243 bool reachLast;
244 boost::tie (foundItem, reachLast, lastItem) = super::getTrie ().find (header.GetName ());
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700245
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700246 if (!reachLast || lastItem == super::end ())
247 return 0;
248 else
249 return lastItem->payload (); // which could also be 0
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700250}
251
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700252template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700253Ptr<Entry>
254PitImpl<Policy>::Create (Ptr<const InterestHeader> header)
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700255{
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700256 Ptr<fib::Entry> fibEntry = m_fib->LongestPrefixMatch (*header);
Alexander Afanasyev3c5b6a72012-07-20 15:35:48 -0700257 if (fibEntry == 0)
258 return 0;
259
260 // NS_ASSERT_MSG (fibEntry != 0,
261 // "There should be at least default route set" <<
262 // " Prefix = "<< header->GetName() << ", NodeID == " << m_fib->GetObject<Node>()->GetId() << "\n" << *m_fib);
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700263
Alexander Afanasyev36b45772012-07-10 16:57:42 -0700264 Ptr< entry > newEntry = ns3::Create< entry > (boost::ref (*this), header, fibEntry);
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700265 std::pair< typename super::iterator, bool > result = super::insert (header->GetName (), newEntry);
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700266 if (result.first != super::end ())
267 {
268 if (result.second)
269 {
270 newEntry->SetTrie (result.first);
271 return newEntry;
272 }
273 else
274 {
275 // should we do anything?
276 // update payload? add new payload?
277 return result.first->payload ();
278 }
279 }
280 else
281 return 0;
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700282}
283
284
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700285template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700286void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700287PitImpl<Policy>::MarkErased (Ptr<Entry> item)
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700288{
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700289 // entry->SetExpireTime (Simulator::Now () + m_PitEntryPruningTimout);
Alexander Afanasyev36b45772012-07-10 16:57:42 -0700290 super::erase (StaticCast< entry > (item)->to_iterator ());
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700291}
292
293
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700294template<class Policy>
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700295void
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700296PitImpl<Policy>::Print (std::ostream& os) const
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700297{
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700298 // !!! unordered_set imposes "random" order of item in the same level !!!
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700299 typename super::parent_trie::const_recursive_iterator item (super::getTrie ()), end (0);
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700300 for (; item != end; item++)
301 {
302 if (item->payload () == 0) continue;
303
304 os << item->payload ()->GetPrefix () << "\t" << *item->payload () << "\n";
305 }
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700306}
307
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700308template<class Policy>
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700309uint32_t
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700310PitImpl<Policy>::GetSize () const
Alexander Afanasyevf1e013f2012-07-11 17:59:40 -0700311{
312 return super::getPolicy ().size ();
313}
314
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700315template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700316Ptr<Entry>
317PitImpl<Policy>::Begin ()
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700318{
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700319 typename super::parent_trie::recursive_iterator item (super::getTrie ()), end (0);
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700320 for (; item != end; item++)
321 {
322 if (item->payload () == 0) continue;
323 break;
324 }
325
326 if (item == end)
327 return End ();
328 else
329 return item->payload ();
330}
331
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700332template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700333Ptr<Entry>
334PitImpl<Policy>::End ()
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700335{
336 return 0;
337}
338
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700339template<class Policy>
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700340Ptr<Entry>
341PitImpl<Policy>::Next (Ptr<Entry> from)
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700342{
343 if (from == 0) return 0;
344
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700345 typename super::parent_trie::recursive_iterator
Alexander Afanasyev36b45772012-07-10 16:57:42 -0700346 item (*StaticCast< entry > (from)->to_iterator ()),
Alexander Afanasyev30f60e32012-07-10 14:21:16 -0700347 end (0);
348
349 for (item++; item != end; item++)
350 {
351 if (item->payload () == 0) continue;
352 break;
353 }
354
355 if (item == end)
356 return End ();
357 else
358 return item->payload ();
359}
360
361
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700362// explicit instantiation and registering
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700363template class PitImpl<persistent_policy_traits>;
364template class PitImpl<random_policy_traits>;
365template class PitImpl<lru_policy_traits>;
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700366
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700367NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, persistent_policy_traits);
368NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, random_policy_traits);
369NS_OBJECT_ENSURE_REGISTERED_TEMPL(PitImpl, lru_policy_traits);
Alexander Afanasyevbd6f3f42012-07-26 17:50:17 -0700370
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -0700371} // namespace pit
372} // namespace ndn
Alexander Afanasyev11f7bb42012-07-09 17:06:30 -0700373} // namespace ns3