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

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

#include <hash-function.h>

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

Public Member Functions

 Hash32 (Hash32Function_ptr hp)
 
void clear ()
 
uint32_t GetHash32 (const char *buffer, const size_t size)
 
- Public Member Functions inherited from ns3::Hash::Implementation
 Implementation ()
 
virtual ~Implementation ()
 
virtual uint64_t GetHash64 (const char *buffer, const size_t size)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Implementation >
 SimpleRefCount ()
 
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 

Private Attributes

Hash32Function_ptr m_fp
 

Additional Inherited Members

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

Detailed Description

Template for Hashfunctions from 32-bit hash functions.

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

Constructor & Destructor Documentation

ns3::Hash::Function::Hash32::Hash32 ( Hash32Function_ptr  hp)
inline

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

Member Function Documentation

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

Restore initial state

Implements ns3::Hash::Implementation.

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

uint32_t ns3::Hash::Function::Hash32::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 123 of file hash-function.h.

References m_fp.

Member Data Documentation

Hash32Function_ptr ns3::Hash::Function::Hash32::m_fp
private

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

Referenced by GetHash32().


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