--- a/doc/manual/Makefile Thu Jul 11 14:45:51 2013 -0700
+++ b/doc/manual/Makefile Thu Jul 11 17:20:11 2013 -0700
@@ -20,6 +20,7 @@
source/enable-tests.rst \
source/events.rst \
source/gnuplot.rst \
+ source/hash-functions.rst \
source/helpers.rst \
source/how-to-write-tests.rst \
source/logging.rst \
--- a/doc/manual/source/hash-functions.rst Thu Jul 11 14:45:51 2013 -0700
+++ b/doc/manual/source/hash-functions.rst Thu Jul 11 17:20:11 2013 -0700
@@ -42,7 +42,7 @@
the hash of a packet stream, but not want to assemble a single buffer
with the combined contents of all the packets.)
-This is almost as straight-forward as the first example:
+This is almost as straight-forward as the first example::
#include "ns3/hash.h"
@@ -55,7 +55,7 @@
for (<every buffer>)
{
- buffer = <get next buffer>;
+ buffer = get_next_buffer ();
hasher (buffer, buffer_size);
}
uint32_t combined_hash = hasher.GetHash32 ();
@@ -64,7 +64,7 @@
hashing. If you want to reuse a ``Hasher`` object (for example
because it's configured with a non-default hash function), but don't
want to add to the previously computed hash, you need to ``clear()``
-first:
+first::
hasher.clear ().GetHash32 (buffer, buffer_size);
@@ -75,7 +75,7 @@
**********************************
The default hash function is murmur3_. FNV1a_ is also available. To specify
-the hash function explicitly, use this contructor:
+the hash function explicitly, use this contructor::
Hasher hasher = Hasher ( Create<Hash::Function::Fnv1a> () );
@@ -89,8 +89,8 @@
from ``Hash::Implementation``.
* ``include`` the declaration in ``hash.h`` (at the point where
``hash-murmur3.h`` is included.
- * In your own code, instantiate a ``Hash`` object via the constructor
- ``Hash (Ptr<Hash::Function::Foo> ())``
+ * In your own code, instantiate a ``Hasher`` object via the constructor
+ ``Hasher (Ptr<Hash::Function::Foo> ())``
If your hash function is a single function, e.g. ``hashf``, you don't
--- a/src/core/examples/hash-example.cc Thu Jul 11 14:45:51 2013 -0700
+++ b/src/core/examples/hash-example.cc Thu Jul 11 17:20:11 2013 -0700
@@ -27,12 +27,18 @@
NS_LOG_COMPONENT_DEFINE ("Hasher");
-using namespace ns3;
-
+namespace ns3
+{
+namespace Hash
+{
-/** Namespace for hasher-example */
-namespace HashExample {
-
+/**
+ * \ingroup hash
+ * Namespace for hasher-example
+*/
+namespace Example
+{
+
/**
* Keep track of collisions
*/
@@ -439,10 +445,15 @@
}; // class DictFiles
+} // namespace Example
-} // namespace HashExample
+} // namespace Hash
+
+} // namespace ns3
-using namespace HashExample;
+
+using namespace ns3;
+using namespace ns3::Hash::Example;
int
main (int argc, char *argv[])
--- a/src/core/model/hash-function.h Thu Jul 11 14:45:51 2013 -0700
+++ b/src/core/model/hash-function.h Thu Jul 11 17:20:11 2013 -0700
@@ -25,6 +25,10 @@
namespace ns3 {
+/**
+ * \ingroup hash
+ * Hash function implementations
+ */
namespace Hash {
/**
@@ -94,10 +98,16 @@
* \brief Basic hash function typedefs.
*
* See Hash32Implementation<> or Hash64Implementation<>
+ * @{
*/
typedef uint32_t (*Hash32Function_ptr) (const char *, const size_t);
typedef uint64_t (*Hash64Function_ptr) (const char *, const size_t);
+/**@}*/
+/**
+ * \ingroup hash
+ * Hash functions
+ */
namespace Function {
/**
--- a/src/core/model/hash.h Thu Jul 11 14:45:51 2013 -0700
+++ b/src/core/model/hash.h Thu Jul 11 17:20:11 2013 -0700
@@ -33,6 +33,10 @@
namespace ns3 {
/**
+ * \ingroup core
+ * \defgroup hash Hash Functions
+ */
+/**
* \ingroup hash
*
* \brief Generic Hash function interface
@@ -40,7 +44,7 @@
* This class provides a generic interface for computing hashes
* of buffers. Various getters return hashes of different lengths.
*
- * Call clear () between calls to the getter to reset the
+ * Call clear() between calls to the getter to reset the
* internal state and hash each buffer separately.
*
* If you don't call clear() between calls to the getter