A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Hash::Function::Hash64 Class Reference

Template for Hashfunctions from 64-bit hash functions. More...

#include <hash-function.h>

+ Inheritance diagram for ns3::Hash::Function::Hash64:
+ Collaboration diagram for ns3::Hash::Function::Hash64:

Public Member Functions

 Hash64 (Hash64Function_ptr hp)
 
void clear ()
 Restore initial state. More...
 
uint32_t GetHash32 (const char *buffer, const size_t size)
 Compute 32-bit hash of a byte buffer. More...
 
uint64_t GetHash64 (const char *buffer, const size_t size)
 Compute 64-bit hash of a byte buffer. More...
 
- Public Member Functions inherited from ns3::Hash::Implementation
 Implementation ()
 Constructor. More...
 
virtual ~Implementation ()
 Destructor. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Implementation >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 

Private Attributes

Hash64Function_ptr m_fp
 

Additional Inherited Members

- Static Public Member Functions inherited from ns3::SimpleRefCount< Implementation >
static void Cleanup (void)
 Noop. More...
 

Detailed Description

Template for Hashfunctions from 64-bit hash functions.

Definition at line 137 of file hash-function.h.

Constructor & Destructor Documentation

ns3::Hash::Function::Hash64::Hash64 ( Hash64Function_ptr  hp)
inline

Definition at line 140 of file hash-function.h.

Member Function Documentation

void ns3::Hash::Function::Hash64::clear ( )
inlinevirtual

Restore initial state.

Implements ns3::Hash::Implementation.

Definition at line 153 of file hash-function.h.

uint32_t ns3::Hash::Function::Hash64::GetHash32 ( const char *  buffer,
const size_t  size 
)
inlinevirtual

Compute 32-bit hash of a byte buffer.

Call clear () between calls to GetHash32() to reset the internal state and hash each buffer separately.

If you don't call clear() between calls to GetHash32, you can hash successive buffers. The final return value will be the cumulative hash across all calls.

Parameters
[in]bufferpointer to the beginning of the buffer
[in]sizelength of the buffer, in bytes
Returns
32-bit hash of the buffer

Implements ns3::Hash::Implementation.

Definition at line 145 of file hash-function.h.

References GetHash64().

+ Here is the call graph for this function:

uint64_t ns3::Hash::Function::Hash64::GetHash64 ( const char *  buffer,
const size_t  size 
)
inlinevirtual

Compute 64-bit hash of a byte buffer.

Default implementation returns 32-bit hash, with a warning.

Call clear () between calls to GetHash64() to reset the internal state and hash each buffer separately.

If you don't call clear() between calls to GetHash64, you can hash successive buffers. The final return value will be the cumulative hash across all calls.

Parameters
[in]bufferpointer to the beginning of the buffer
[in]sizelength of the buffer, in bytes
Returns
64-bit hash of the buffer

Reimplemented from ns3::Hash::Implementation.

Definition at line 141 of file hash-function.h.

References m_fp.

Referenced by GetHash32().

+ Here is the caller graph for this function:

Member Data Documentation

Hash64Function_ptr ns3::Hash::Function::Hash64::m_fp
private

Definition at line 153 of file hash-function.h.

Referenced by GetHash64().


The documentation for this class was generated from the following file: