Modification of CcnxFace interface and unification of CCNx applications via common CcnxApp class

Moving functionality of interest limits from PIT to Face.

!!! Code compiles, but probably doesn't work !!!
diff --git a/apps/ccnx-app.h b/apps/ccnx-app.h
new file mode 100644
index 0000000..4f2cb83
--- /dev/null
+++ b/apps/ccnx-app.h
@@ -0,0 +1,104 @@
+/* -*-  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 CCNX_APP_H
+#define CCNX_APP_H
+
+#include "ns3/application.h"
+#include "ns3/ptr.h"
+#include "ns3/callback.h"
+
+namespace ns3 
+{
+
+class Packet;
+class CcnxInterestHeader;
+class CcnxContentObjectHeader;
+
+/**
+ * @ingroup ccnx
+ * @brief Base class that all CCNx applications should be derived from.
+ * 
+ * The class implements virtual calls onInterest, onNack, and onContentObject
+ */
+class CcnxApp: public Application
+{
+public:
+  typedef Callback<bool, const Ptr<CcnxFace>&> ProtocolHandler;
+  
+  static TypeId GetTypeId ();
+
+  /**
+   * @brief Default constructor
+   */
+  CcnxApp ();
+  virtual ~CcnxApp ();
+
+  /**
+   * @brief Register lower layer callback (to send interests from the application)
+   */
+  void
+  RegisterProtocolHandler (ProtocolHandler handler);
+  
+  /**
+   * @brief Method that will be called every time new Interest arrives
+   * @param interest Interest header
+   */
+  virtual void
+  OnInterest (const Ptr<const CcnxInterestHeader> &interest);
+
+  /**
+   * @brief Method that will be called every time new NACK arrives
+   * @param interest Interest header
+   */
+  virtual void
+  OnNack (const Ptr<const CcnxInterestHeader> &interest);
+  
+  /**
+   * @brief Method that will be called every time new ContentObject arrives
+   * @param contentObject ContentObject header
+   * @param payload payload (potentially virtual) of the ContentObject packet
+   */
+  virtual void
+  OnContentObject (const Ptr<const CcnxContentObjectHeader> &contentObject,
+                   const Ptr<const Packet> &payload);
+        
+protected:
+  virtual void
+  DoDispose ();
+
+  // inherited from Application base class.
+  virtual void
+  StartApplication ();    // Called at time specified by Start
+
+  virtual void
+  StopApplication ();     // Called at time specified by Stop
+
+protected:
+  ProtocolHandler m_protocolHandler;
+  bool m_active; 
+
+private:
+  Ptr<CcnxFace> m_face; // local face that is created 
+};
+
+} // namespace ns3
+
+#endif // CCNX_APP_H