model: First set of major API changes and reorganizations
Main motive: change interface in Face class, resulting in need to change forwarding strategy interfaces
Refs #1005 (http://redmine.named-data.net/)
diff --git a/apps/ndn-app.cc b/apps/ndn-app.cc
index d29f509..7880849 100644
--- a/apps/ndn-app.cc
+++ b/apps/ndn-app.cc
@@ -64,8 +64,7 @@
}
App::App ()
- : m_protocolHandler (0)
- , m_active (false)
+ : m_active (false)
, m_face (0)
{
}
@@ -85,12 +84,6 @@
Application::DoDispose ();
}
-void
-App::RegisterProtocolHandler (ProtocolHandler handler)
-{
- m_protocolHandler = handler;
-}
-
uint32_t
App::GetId () const
{
@@ -164,7 +157,7 @@
// step 3. Destroy face
if (m_face->GetReferenceCount () != 1)
{
- NS_LOG_ERROR ("Please a bug report on https://github.com/NDN-Routing/ndnSIM/issues:");
+ NS_LOG_ERROR ("Please a bug report on https://github.com/NDN-Routing/ndnSIM/issues");
NS_LOG_ERROR ("At this point, nobody else should have referenced this face, but we have "
<< m_face->GetReferenceCount () << " references");
diff --git a/apps/ndn-app.h b/apps/ndn-app.h
index 57d1d83..491cae4 100644
--- a/apps/ndn-app.h
+++ b/apps/ndn-app.h
@@ -35,9 +35,6 @@
class Interest;
class ContentObject;
-typedef Interest InterestHeader;
-typedef ContentObject ContentObjectHeader;
-
class Face;
/**
@@ -52,7 +49,8 @@
/**
* @brief A callback to pass packets to underlying NDN protocol
*/
- typedef Callback<bool, const Ptr<const Packet>&> ProtocolHandler;
+ typedef Callback<bool, Ptr<const Interest>, Ptr<const Packet> > InterestHandler;
+ typedef Callback<bool, Ptr<const ContentObject>, Ptr<const Packet> > DataHandler;
static TypeId GetTypeId ();
@@ -63,12 +61,6 @@
virtual ~App ();
/**
- * @brief Register lower layer callback (to send interests from the application)
- */
- void
- RegisterProtocolHandler (ProtocolHandler handler);
-
- /**
* @brief Get application ID (ID of applications face)
*/
uint32_t
@@ -114,7 +106,6 @@
StopApplication (); ///< @brief Called at time specified by Stop
protected:
- ProtocolHandler m_protocolHandler; ///< @brief A callback to pass packets to underlying NDN protocol
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