--- a/src/core/model/hash-fnv.cc Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash-fnv.cc Tue Nov 13 16:35:21 2012 -0800
@@ -742,6 +742,11 @@
return result;
}
+void
+Fnv1a::clear (void)
+{
+}
+
} // namespace HashFunction
} // namespace ns3
--- a/src/core/model/hash-fnv.h Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash-fnv.h Tue Nov 13 16:35:21 2012 -0800
@@ -52,6 +52,10 @@
* \return 64-bit hash of the buffer
*/
Hash64_t GetHash64 (const char * buffer, const size_t size);
+ /**
+ * Restore initial state
+ */
+ virtual void clear (void);
private:
/**
--- a/src/core/model/hash-implementation.h Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash-implementation.h Tue Nov 13 16:35:21 2012 -0800
@@ -60,6 +60,10 @@
* \return 64-bit hash of the buffer
*/
virtual Hash64_t GetHash64 (const char * buffer, const size_t size);
+ /**
+ * Restore initial state
+ */
+ virtual void clear (void) = 0;
/*
* Destructor
*/
--- a/src/core/model/hash-murmur3.cc Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash-murmur3.cc Tue Nov 13 16:35:21 2012 -0800
@@ -374,6 +374,11 @@
return result[0];
}
+void
+Murmur3::clear (void)
+{
+}
+
} // namespace HashFunction
} // namespace ns3
--- a/src/core/model/hash-murmur3.h Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash-murmur3.h Tue Nov 13 16:35:21 2012 -0800
@@ -61,6 +61,10 @@
* \return 64-bit hash of the buffer
*/
Hash64_t GetHash64 (const char * buffer, const size_t size);
+ /**
+ * Restore initial state
+ */
+ virtual void clear (void);
private:
/**
--- a/src/core/model/hash.cc Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash.cc Tue Nov 13 16:35:21 2012 -0800
@@ -41,5 +41,12 @@
{
NS_ASSERT (m_impl != 0);
}
-
+
+Hash *
+Hash::clear (void)
+{
+ m_impl->clear();
+ return this;
+}
+
} // namespace ns3
--- a/src/core/model/hash.h Tue Nov 13 16:34:34 2012 -0800
+++ b/src/core/model/hash.h Tue Nov 13 16:35:21 2012 -0800
@@ -104,6 +104,12 @@
* \return 64-bit hash of the string
*/
Hash64_t GetHash64 (const std::string s);
+ /**
+ * Restore initial state
+ *
+ * \return this
+ */
+ Hash * clear (void);
private:
Ptr<HashImplementation> m_impl; /** Hash implementation */