all: InterestHeader and ContentObjectHeader refactoring to Interest and ContentObject
refs #29
diff --git a/apps/ndn-app.cc b/apps/ndn-app.cc
index dcf164d..d29f509 100644
--- a/apps/ndn-app.cc
+++ b/apps/ndn-app.cc
@@ -101,21 +101,21 @@
}
void
-App::OnInterest (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet)
+App::OnInterest (const Ptr<const Interest> &interest, Ptr<Packet> packet)
{
NS_LOG_FUNCTION (this << interest);
m_receivedInterests (interest, this, m_face);
}
void
-App::OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet)
+App::OnNack (const Ptr<const Interest> &interest, Ptr<Packet> packet)
{
NS_LOG_FUNCTION (this << interest);
m_receivedNacks (interest, this, m_face);
}
void
-App::OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+App::OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload)
{
NS_LOG_FUNCTION (this << contentObject << payload);
diff --git a/apps/ndn-app.h b/apps/ndn-app.h
index 94fb4a7..749dc9e 100644
--- a/apps/ndn-app.h
+++ b/apps/ndn-app.h
@@ -32,8 +32,8 @@
namespace ndn {
-class InterestHeader;
-class ContentObjectHeader;
+class Interest;
+class ContentObject;
class Face;
/**
@@ -77,14 +77,14 @@
* may be useful to get packet tags
*/
virtual void
- OnInterest (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet);
+ OnInterest (const Ptr<const Interest> &interest, Ptr<Packet> packet);
/**
* @brief Method that will be called every time new NACK arrives
* @param interest Interest header
*/
virtual void
- OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet);
+ OnNack (const Ptr<const Interest> &interest, Ptr<Packet> packet);
/**
* @brief Method that will be called every time new ContentObject arrives
@@ -92,7 +92,7 @@
* @param payload payload (potentially virtual) of the ContentObject packet (may include packet tags of original packet)
*/
virtual void
- OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload);
protected:
@@ -114,20 +114,20 @@
bool m_active; ///< @brief Flag to indicate that application is active (set by StartApplication and StopApplication)
Ptr<Face> m_face; ///< @brief automatically created application face through which application communicates
- TracedCallback<Ptr<const InterestHeader>,
+ TracedCallback<Ptr<const Interest>,
Ptr<App>, Ptr<Face> > m_receivedInterests; ///< @brief App-level trace of received Interests
- TracedCallback<Ptr<const InterestHeader>,
+ TracedCallback<Ptr<const Interest>,
Ptr<App>, Ptr<Face> > m_receivedNacks; ///< @brief App-level trace of received NACKs
- TracedCallback<Ptr<const ContentObjectHeader>, Ptr<const Packet>,
+ TracedCallback<Ptr<const ContentObject>, Ptr<const Packet>,
Ptr<App>, Ptr<Face> > m_receivedContentObjects; ///< @brief App-level trace of received Data
- TracedCallback<Ptr<const InterestHeader>,
+ TracedCallback<Ptr<const Interest>,
Ptr<App>, Ptr<Face> > m_transmittedInterests; ///< @brief App-level trace of transmitted Interests
- TracedCallback<Ptr<const ContentObjectHeader>, Ptr<const Packet>,
+ TracedCallback<Ptr<const ContentObject>, Ptr<const Packet>,
Ptr<App>, Ptr<Face> > m_transmittedContentObjects; ///< @brief App-level trace of transmitted Data
};
diff --git a/apps/ndn-consumer-batches.h b/apps/ndn-consumer-batches.h
index a8c67b7..22b9b0c 100644
--- a/apps/ndn-consumer-batches.h
+++ b/apps/ndn-consumer-batches.h
@@ -44,13 +44,13 @@
// From App
// virtual void
- // OnInterest (const Ptr<const InterestHeader> &interest);
+ // OnInterest (const Ptr<const Interest> &interest);
// virtual void
- // OnNack (const Ptr<const InterestHeader> &interest);
+ // OnNack (const Ptr<const Interest> &interest);
// virtual void
- // OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ // OnContentObject (const Ptr<const ContentObject> &contentObject,
// const Ptr<const Packet> &payload);
// virtual void
diff --git a/apps/ndn-consumer-cbr.cc b/apps/ndn-consumer-cbr.cc
index 84fdd18..6ddedd8 100644
--- a/apps/ndn-consumer-cbr.cc
+++ b/apps/ndn-consumer-cbr.cc
@@ -137,14 +137,14 @@
///////////////////////////////////////////////////
// void
-// Consumer::OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+// Consumer::OnContentObject (const Ptr<const ContentObject> &contentObject,
// const Ptr<const Packet> &payload)
// {
// Consumer::OnContentObject (contentObject, payload); // tracing inside
// }
// void
-// Consumer::OnNack (const Ptr<const InterestHeader> &interest)
+// Consumer::OnNack (const Ptr<const Interest> &interest)
// {
// Consumer::OnNack (interest); // tracing inside
// }
diff --git a/apps/ndn-consumer-cbr.h b/apps/ndn-consumer-cbr.h
index 01e84a5..6143268 100644
--- a/apps/ndn-consumer-cbr.h
+++ b/apps/ndn-consumer-cbr.h
@@ -45,13 +45,13 @@
// From NdnApp
// virtual void
- // OnInterest (const Ptr<const InterestHeader> &interest);
+ // OnInterest (const Ptr<const Interest> &interest);
// virtual void
- // OnNack (const Ptr<const InterestHeader> &interest);
+ // OnNack (const Ptr<const Interest> &interest);
// virtual void
- // OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ // OnContentObject (const Ptr<const ContentObject> &contentObject,
// const Ptr<const Packet> &payload);
protected:
diff --git a/apps/ndn-consumer-window.cc b/apps/ndn-consumer-window.cc
index f214a9e..7e8325d 100644
--- a/apps/ndn-consumer-window.cc
+++ b/apps/ndn-consumer-window.cc
@@ -162,7 +162,7 @@
///////////////////////////////////////////////////
void
-ConsumerWindow::OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ConsumerWindow::OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload)
{
Consumer::OnContentObject (contentObject, payload);
@@ -176,7 +176,7 @@
}
void
-ConsumerWindow::OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> payload)
+ConsumerWindow::OnNack (const Ptr<const Interest> &interest, Ptr<Packet> payload)
{
Consumer::OnNack (interest, payload);
diff --git a/apps/ndn-consumer-window.h b/apps/ndn-consumer-window.h
index 32ad8aa..df79fb3 100644
--- a/apps/ndn-consumer-window.h
+++ b/apps/ndn-consumer-window.h
@@ -47,13 +47,13 @@
// From App
// virtual void
- // OnInterest (const Ptr<const InterestHeader> &interest);
+ // OnInterest (const Ptr<const Interest> &interest);
virtual void
- OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> payload);
+ OnNack (const Ptr<const Interest> &interest, Ptr<Packet> payload);
virtual void
- OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload);
virtual void
diff --git a/apps/ndn-consumer-zipf-mandelbrot.cc b/apps/ndn-consumer-zipf-mandelbrot.cc
index faebd6c..5d5d760 100644
--- a/apps/ndn-consumer-zipf-mandelbrot.cc
+++ b/apps/ndn-consumer-zipf-mandelbrot.cc
@@ -178,7 +178,7 @@
(*nameWithSequence) (seq);
//
- InterestHeader interestHeader;
+ Interest interestHeader;
interestHeader.SetNonce (m_rand.GetValue ());
interestHeader.SetName (nameWithSequence);
diff --git a/apps/ndn-consumer.cc b/apps/ndn-consumer.cc
index 24b4bde..e579312 100644
--- a/apps/ndn-consumer.cc
+++ b/apps/ndn-consumer.cc
@@ -202,7 +202,7 @@
(*nameWithSequence) (seq);
//
- InterestHeader interestHeader;
+ Interest interestHeader;
interestHeader.SetNonce (m_rand.GetValue ());
interestHeader.SetName (nameWithSequence);
interestHeader.SetInterestLifetime (m_interestLifeTime);
@@ -242,7 +242,7 @@
void
-Consumer::OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+Consumer::OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload)
{
if (!m_active) return;
@@ -286,7 +286,7 @@
}
void
-Consumer::OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> origPacket)
+Consumer::OnNack (const Ptr<const Interest> &interest, Ptr<Packet> origPacket)
{
if (!m_active) return;
diff --git a/apps/ndn-consumer.h b/apps/ndn-consumer.h
index 918d946..b748c2a 100644
--- a/apps/ndn-consumer.h
+++ b/apps/ndn-consumer.h
@@ -58,13 +58,13 @@
// From App
// virtual void
- // OnInterest (const Ptr<const InterestHeader> &interest);
+ // OnInterest (const Ptr<const Interest> &interest);
virtual void
- OnNack (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet);
+ OnNack (const Ptr<const Interest> &interest, Ptr<Packet> packet);
virtual void
- OnContentObject (const Ptr<const ContentObjectHeader> &contentObject,
+ OnContentObject (const Ptr<const ContentObject> &contentObject,
Ptr<Packet> payload);
/**
diff --git a/apps/ndn-producer.cc b/apps/ndn-producer.cc
index 00f374e..90ccce0 100644
--- a/apps/ndn-producer.cc
+++ b/apps/ndn-producer.cc
@@ -108,7 +108,7 @@
void
-Producer::OnInterest (const Ptr<const InterestHeader> &interest, Ptr<Packet> origPacket)
+Producer::OnInterest (const Ptr<const Interest> &interest, Ptr<Packet> origPacket)
{
App::OnInterest (interest, origPacket); // tracing inside
@@ -117,7 +117,7 @@
if (!m_active) return;
static ContentObjectTail tail;
- Ptr<ContentObjectHeader> header = Create<ContentObjectHeader> ();
+ Ptr<ContentObject> header = Create<ContentObject> ();
header->SetName (Create<Name> (interest->GetName ()));
header->SetFreshness (m_freshness);
diff --git a/apps/ndn-producer.h b/apps/ndn-producer.h
index f383643..bce01d3 100644
--- a/apps/ndn-producer.h
+++ b/apps/ndn-producer.h
@@ -48,7 +48,7 @@
Producer ();
// inherited from NdnApp
- void OnInterest (const Ptr<const InterestHeader> &interest, Ptr<Packet> packet);
+ void OnInterest (const Ptr<const Interest> &interest, Ptr<Packet> packet);
protected:
// inherited from Application base class.