model+cs: Now it is possible to get pointer to ContentStore from cs::Entry
In some cases it is desirable to know which ContentStore (=on which
Node) a particular cs::Entry belongs to. Now it is possible to
accomplish this task using cs::Entry::GetContentStore method.
diff --git a/model/cs/ndn-content-store.cc b/model/cs/ndn-content-store.cc
index 90a5699..fbe85ce 100644
--- a/model/cs/ndn-content-store.cc
+++ b/model/cs/ndn-content-store.cc
@@ -60,8 +60,9 @@
//////////////////////////////////////////////////////////////////////
-Entry::Entry (Ptr<const ContentObjectHeader> header, Ptr<const Packet> packet)
- : m_header (header)
+Entry::Entry (Ptr<ContentStore> cs, Ptr<const ContentObjectHeader> header, Ptr<const Packet> packet)
+ : m_cs (cs)
+ , m_header (header)
, m_packet (packet->Copy ())
{
}
@@ -95,6 +96,13 @@
return m_packet;
}
+Ptr<ContentStore>
+Entry::GetContentStore ()
+{
+ return m_cs;
+}
+
+
} // namespace cs
} // namespace ndn
} // namespace ns3