all: Adding typedefs near forward declarations of Interest/ContentObject/Name
refs #29
diff --git a/apps/ndn-app.h b/apps/ndn-app.h
index 749dc9e..57d1d83 100644
--- a/apps/ndn-app.h
+++ b/apps/ndn-app.h
@@ -34,6 +34,10 @@
class Interest;
class ContentObject;
+
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
class Face;
/**
diff --git a/disabled/ndn-decoding-helper.h b/disabled/ndn-decoding-helper.h
index 10b4dda..8a33be3 100644
--- a/disabled/ndn-decoding-helper.h
+++ b/disabled/ndn-decoding-helper.h
@@ -30,6 +30,9 @@
class Interest;
class ContentObject;
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
/**
* \brief Helper class to decode ccnb formatted Ndn message
*/
diff --git a/disabled/ndn-encoding-helper.h b/disabled/ndn-encoding-helper.h
index ae66684..d28425c 100644
--- a/disabled/ndn-encoding-helper.h
+++ b/disabled/ndn-encoding-helper.h
@@ -32,10 +32,14 @@
namespace ndn {
class Name;
+typedef Name NameComponents;
class Interest;
class ContentObject;
-
+
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
/**
* \brief Helper to encode/decode ccnb formatted Ndn message
*/
diff --git a/helper/ndn-header-helper.h b/helper/ndn-header-helper.h
index cce07dd..c8c46c9 100644
--- a/helper/ndn-header-helper.h
+++ b/helper/ndn-header-helper.h
@@ -31,6 +31,7 @@
namespace ndn {
class Name;
+typedef Name NameComponents;
/**
* \ingroup ndn-helpers
diff --git a/model/cs/ndn-content-store.h b/model/cs/ndn-content-store.h
index 9edfb52..54901d9 100644
--- a/model/cs/ndn-content-store.h
+++ b/model/cs/ndn-content-store.h
@@ -36,7 +36,12 @@
class ContentObject;
class Interest;
+
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
class Name;
+typedef Name NameComponents;
class ContentStore;
diff --git a/model/fib/ndn-fib-entry.h b/model/fib/ndn-fib-entry.h
index 9cb3aec..4b3f64c 100644
--- a/model/fib/ndn-fib-entry.h
+++ b/model/fib/ndn-fib-entry.h
@@ -41,6 +41,7 @@
namespace ndn {
class Name;
+typedef Name NameComponents;
namespace fib {
diff --git a/model/fib/ndn-fib.h b/model/fib/ndn-fib.h
index 85e0eaf..6e21214 100644
--- a/model/fib/ndn-fib.h
+++ b/model/fib/ndn-fib.h
@@ -30,6 +30,7 @@
namespace ndn {
class Interest;
+typedef Interest InterestHeader;
/**
* \ingroup ndn
diff --git a/model/fw/ndn-forwarding-strategy.h b/model/fw/ndn-forwarding-strategy.h
index 5e624b6..b87b07d 100644
--- a/model/fw/ndn-forwarding-strategy.h
+++ b/model/fw/ndn-forwarding-strategy.h
@@ -30,8 +30,13 @@
namespace ndn {
class Face;
+
class Interest;
class ContentObject;
+
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
class Pit;
namespace pit { class Entry; }
class FibFaceMetric;
diff --git a/model/ndn-app-face.h b/model/ndn-app-face.h
index 276fdfd..3a90f11 100644
--- a/model/ndn-app-face.h
+++ b/model/ndn-app-face.h
@@ -33,6 +33,10 @@
class Interest;
class ContentObject;
+
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
class App;
/**
diff --git a/model/ndn-content-object.h b/model/ndn-content-object.h
index 2022f2f..c26d5c1 100644
--- a/model/ndn-content-object.h
+++ b/model/ndn-content-object.h
@@ -39,13 +39,13 @@
/**
* ContentObject header
- *
+ *
* Only few important fields are actually implemented in the simulation
*
* ContentObject serializes/deserializes header up-to and including <Content> tags
* Necessary closing tags should be added using ContentObjectTail
*
- * Optimized and simplified formatting of Interest packets
+ * Optimized and simplified formatting of Interest packets
*
* ContentObject ::= Signature
* Name
@@ -54,7 +54,7 @@
* This hacks are necessary to optimize memory use (i.e., virtual payload)
*
* "<ContentObject><Signature>..</Signature><Name>...</Name><SignedInfo>...</SignedInfo><Content>"
- *
+ *
*/
class ContentObject : public SimpleRefCount<ContentObject,Header>
{
@@ -98,7 +98,7 @@
*/
Time
GetTimestamp () const;
-
+
/**
* @brief Set freshness of the content object
* @param freshness Freshness, 0s means infinity
@@ -111,23 +111,23 @@
*/
Time
GetFreshness () const;
-
+
//////////////////////////////////////////////////////////////////
-
+
static TypeId GetTypeId (void); ///< @brief Get TypeId
virtual TypeId GetInstanceTypeId (void) const; ///< @brief Get TypeId of the instance
virtual void Print (std::ostream &os) const; ///< @brief Print out information about the Header into the stream
virtual uint32_t GetSerializedSize (void) const; ///< @brief Get size necessary to serialize the Header
virtual void Serialize (Buffer::Iterator start) const; ///< @brief Serialize the Header
virtual uint32_t Deserialize (Buffer::Iterator start); ///< @brief Deserialize the Header
-
+
private:
Ptr<Name> m_name;
Time m_freshness;
Time m_timestamp;
};
-typedef ContentObject ContentObjectHeader;
+typedef ContentObject ContentObjectHeader;
/**
* ContentObjectTail for compatibility with other packet formats
@@ -137,7 +137,7 @@
public:
ContentObjectTail ();
//////////////////////////////////////////////////////////////////
-
+
static TypeId GetTypeId (void); ///< @brief Get TypeId
virtual TypeId GetInstanceTypeId (void) const; ///< @brief Get TypeId of the instance
virtual void Print (std::ostream &os) const; ///< @brief Print out information about Tail into the stream
@@ -149,7 +149,7 @@
/**
* @ingroup ndn-exceptions
- * @brief Class for ContentObject parsing exception
+ * @brief Class for ContentObject parsing exception
*/
class ContentObjectException {};
diff --git a/model/ndn-global-router.h b/model/ndn-global-router.h
index 582b6e1..1ef6329 100644
--- a/model/ndn-global-router.h
+++ b/model/ndn-global-router.h
@@ -37,6 +37,8 @@
class Face;
class Name;
+typedef Name NameComponents;
+
/**
* @brief Class representing global router interface for ndnSIM
*/
diff --git a/model/ndn-l3-protocol.h b/model/ndn-l3-protocol.h
index 36330cb..2505a63 100644
--- a/model/ndn-l3-protocol.h
+++ b/model/ndn-l3-protocol.h
@@ -42,6 +42,9 @@
class Interest;
class ContentObject;
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
/**
* \defgroup ndn ndnSIM: NDN simulation module
*
diff --git a/model/pit/ndn-pit.h b/model/pit/ndn-pit.h
index 1968bd4..186f8c4 100644
--- a/model/pit/ndn-pit.h
+++ b/model/pit/ndn-pit.h
@@ -35,6 +35,9 @@
class ContentObject;
class Interest;
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
diff --git a/utils/tracers/ndn-cs-tracer.h b/utils/tracers/ndn-cs-tracer.h
index ff5fc89..eb6f0b3 100644
--- a/utils/tracers/ndn-cs-tracer.h
+++ b/utils/tracers/ndn-cs-tracer.h
@@ -42,6 +42,9 @@
class Interest;
class ContentObject;
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
namespace cs {
struct Stats
diff --git a/utils/tracers/ndn-l3-tracer.h b/utils/tracers/ndn-l3-tracer.h
index 13c2630..45eec7d 100644
--- a/utils/tracers/ndn-l3-tracer.h
+++ b/utils/tracers/ndn-l3-tracer.h
@@ -31,10 +31,14 @@
namespace ndn {
-class Interest;
class Face;
+
+class Interest;
class ContentObject;
+typedef Interest InterestHeader;
+typedef ContentObject ContentObjectHeader;
+
/**
* @brief Base class for network-layer (incoming/outgoing Interests and Data) tracing of NDN stack
*/