Tweak Hash docs, fix manual index error
authorPeter D. Barnes, Jr. <barnes26@llnl.gov>
Thu, 11 Jul 2013 17:20:11 -0700
changeset 99459a867fd76097
parent 9944 fe52d2eda4e7
child 9946 df4a7e93c13d
Tweak Hash docs, fix manual index error
doc/manual/Makefile
doc/manual/source/hash-functions.rst
src/core/examples/hash-example.cc
src/core/model/hash-function.h
src/core/model/hash.h
     1.1 --- a/doc/manual/Makefile	Thu Jul 11 14:45:51 2013 -0700
     1.2 +++ b/doc/manual/Makefile	Thu Jul 11 17:20:11 2013 -0700
     1.3 @@ -20,6 +20,7 @@
     1.4  	source/enable-tests.rst \
     1.5  	source/events.rst \
     1.6  	source/gnuplot.rst \
     1.7 +	source/hash-functions.rst \
     1.8  	source/helpers.rst \
     1.9  	source/how-to-write-tests.rst \
    1.10  	source/logging.rst \
     2.1 --- a/doc/manual/source/hash-functions.rst	Thu Jul 11 14:45:51 2013 -0700
     2.2 +++ b/doc/manual/source/hash-functions.rst	Thu Jul 11 17:20:11 2013 -0700
     2.3 @@ -42,7 +42,7 @@
     2.4  the hash of a packet stream, but not want to assemble a single buffer
     2.5  with the combined contents of all the packets.)
     2.6  
     2.7 -This is almost as straight-forward as the first example:
     2.8 +This is almost as straight-forward as the first example::
     2.9  
    2.10    #include "ns3/hash.h"
    2.11  
    2.12 @@ -55,7 +55,7 @@
    2.13  
    2.14    for (<every buffer>)
    2.15      {
    2.16 -	buffer = <get next buffer>;
    2.17 +	buffer = get_next_buffer ();
    2.18  	hasher (buffer, buffer_size);
    2.19      }
    2.20    uint32_t combined_hash = hasher.GetHash32 ();
    2.21 @@ -64,7 +64,7 @@
    2.22  hashing.  If you want to reuse a ``Hasher`` object (for example
    2.23  because it's configured with a non-default hash function), but don't
    2.24  want to add to the previously computed hash, you need to ``clear()``
    2.25 -first:
    2.26 +first::
    2.27  
    2.28    hasher.clear ().GetHash32 (buffer, buffer_size);
    2.29  
    2.30 @@ -75,7 +75,7 @@
    2.31  **********************************
    2.32  
    2.33  The default hash function is murmur3_.  FNV1a_ is also available.  To specify
    2.34 -the hash function explicitly, use this contructor:
    2.35 +the hash function explicitly, use this contructor::
    2.36  
    2.37    Hasher hasher = Hasher ( Create<Hash::Function::Fnv1a> () );
    2.38  
    2.39 @@ -89,8 +89,8 @@
    2.40     from ``Hash::Implementation``.
    2.41   * ``include`` the declaration in ``hash.h`` (at the point where
    2.42     ``hash-murmur3.h`` is included.
    2.43 - * In your own code, instantiate a ``Hash`` object via the constructor
    2.44 -   ``Hash (Ptr<Hash::Function::Foo> ())``
    2.45 + * In your own code, instantiate a ``Hasher`` object via the constructor
    2.46 +   ``Hasher (Ptr<Hash::Function::Foo> ())``
    2.47     
    2.48  
    2.49  If your hash function is a single function, e.g. ``hashf``, you don't
     3.1 --- a/src/core/examples/hash-example.cc	Thu Jul 11 14:45:51 2013 -0700
     3.2 +++ b/src/core/examples/hash-example.cc	Thu Jul 11 17:20:11 2013 -0700
     3.3 @@ -27,12 +27,18 @@
     3.4  
     3.5  NS_LOG_COMPONENT_DEFINE ("Hasher");
     3.6  
     3.7 -using namespace ns3;
     3.8 +namespace ns3
     3.9 +{
    3.10 +namespace Hash
    3.11 +{
    3.12  
    3.13 -
    3.14 -/** Namespace for hasher-example */
    3.15 -namespace HashExample {
    3.16 -
    3.17 +/**
    3.18 + * \ingroup hash
    3.19 + *  Namespace for hasher-example
    3.20 +*/
    3.21 +namespace Example
    3.22 +{
    3.23 +  
    3.24  /**
    3.25   * Keep track of collisions
    3.26   */
    3.27 @@ -439,10 +445,15 @@
    3.28  
    3.29  };  // class DictFiles
    3.30  
    3.31 +}  // namespace Example
    3.32  
    3.33 -}  // namespace HashExample
    3.34 +}  // namespace Hash
    3.35  
    3.36 -using namespace HashExample;
    3.37 +}  // namespace ns3
    3.38 +
    3.39 +
    3.40 +using namespace ns3;
    3.41 +using namespace ns3::Hash::Example;
    3.42  
    3.43  int 
    3.44  main (int argc, char *argv[])
     4.1 --- a/src/core/model/hash-function.h	Thu Jul 11 14:45:51 2013 -0700
     4.2 +++ b/src/core/model/hash-function.h	Thu Jul 11 17:20:11 2013 -0700
     4.3 @@ -25,6 +25,10 @@
     4.4  
     4.5  namespace ns3 {
     4.6  
     4.7 +/**
     4.8 + * \ingroup hash
     4.9 + * Hash function implementations
    4.10 + */
    4.11  namespace Hash {
    4.12  
    4.13  /**
    4.14 @@ -94,10 +98,16 @@
    4.15   * \brief Basic hash function typedefs.
    4.16   *
    4.17   * See Hash32Implementation<> or Hash64Implementation<>
    4.18 + * @{
    4.19   */
    4.20  typedef uint32_t (*Hash32Function_ptr) (const char *, const size_t);
    4.21  typedef uint64_t (*Hash64Function_ptr) (const char *, const size_t);
    4.22 +/**@}*/
    4.23  
    4.24 +/**
    4.25 + * \ingroup hash
    4.26 + * Hash functions
    4.27 + */
    4.28  namespace Function {
    4.29  
    4.30  /**
     5.1 --- a/src/core/model/hash.h	Thu Jul 11 14:45:51 2013 -0700
     5.2 +++ b/src/core/model/hash.h	Thu Jul 11 17:20:11 2013 -0700
     5.3 @@ -33,6 +33,10 @@
     5.4  namespace ns3 {
     5.5  
     5.6  /**
     5.7 + * \ingroup core
     5.8 + * \defgroup hash Hash Functions
     5.9 + */
    5.10 +/**
    5.11   *  \ingroup hash
    5.12   *
    5.13   *  \brief Generic Hash function interface
    5.14 @@ -40,7 +44,7 @@
    5.15   *  This class provides a generic interface for computing hashes
    5.16   *  of buffers.  Various getters return hashes of different lengths.
    5.17   *
    5.18 - *  Call clear () between calls to the getter to reset the
    5.19 + *  Call clear() between calls to the getter to reset the
    5.20   *  internal state and hash each buffer separately.
    5.21   *
    5.22   *  If you don't call clear() between calls to the getter