First step of refactoring code (ccnx prefix => ndn prefix)
diff --git a/model/pit/ndn-pit-entry-impl.h b/model/pit/ndn-pit-entry-impl.h
new file mode 100644
index 0000000..13cceb5
--- /dev/null
+++ b/model/pit/ndn-pit-entry-impl.h
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef _NDN_PIT_ENTRY_IMPL_H_
+#define _NDN_PIT_ENTRY_IMPL_H_
+
+namespace ns3 {
+
+class NdnPit;
+class NdnInterestHeader;
+class NdnFibEntry;
+
+template<class Pit>
+class NdnPitEntryImpl : public NdnPitEntry
+{
+ typedef NdnPitEntry super;
+ #define CONTAINER static_cast<Pit&> (m_container)
+
+public:
+ NdnPitEntryImpl (NdnPit &pit,
+ Ptr<const NdnInterestHeader> header,
+ Ptr<NdnFibEntry> fibEntry)
+ : NdnPitEntry (pit, header, fibEntry)
+ , item_ (0)
+ {
+ CONTAINER.i_time.insert (*this);
+ CONTAINER.RescheduleCleaning ();
+ }
+
+ virtual ~NdnPitEntryImpl ()
+ {
+ CONTAINER.i_time.erase (Pit::time_index::s_iterator_to (*this));
+
+ CONTAINER.RescheduleCleaning ();
+ }
+
+ virtual void
+ UpdateLifetime (const Time &offsetTime)
+ {
+ CONTAINER.i_time.erase (Pit::time_index::s_iterator_to (*this));
+ super::UpdateLifetime (offsetTime);
+ CONTAINER.i_time.insert (*this);
+
+ CONTAINER.RescheduleCleaning ();
+ }
+
+
+ // to make sure policies work
+ void
+ SetTrie (typename Pit::super::iterator item) { item_ = item; }
+
+ typename Pit::super::iterator to_iterator () { return item_; }
+ typename Pit::super::const_iterator to_iterator () const { return item_; }
+
+public:
+ boost::intrusive::set_member_hook<> time_hook_;
+
+private:
+ typename Pit::super::iterator item_;
+};
+
+template<class T>
+struct TimestampIndex
+{
+ bool
+ operator () (const T &a, const T &b) const
+ {
+ return a.GetExpireTime () < b.GetExpireTime ();
+ }
+};
+
+} // ns3
+
+#endif