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

Hash function implementation base class. More...

#include <hash-function.h>

+ Inheritance diagram for ns3::Hash::Implementation:
+ Collaboration diagram for ns3::Hash::Implementation:

Public Member Functions

 Implementation ()
 Constructor. More...
 
virtual ~Implementation ()
 Destructor. More...
 
virtual void clear (void)=0
 Restore initial state. More...
 
virtual uint32_t GetHash32 (const char *buffer, const size_t size)=0
 Compute 32-bit hash of a byte buffer. More...
 
virtual 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::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...
 

Additional Inherited Members

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

Detailed Description

Hash function implementation base class.

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

Constructor & Destructor Documentation

ns3::Hash::Implementation::Implementation ( )
inline

Constructor.

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

virtual ns3::Hash::Implementation::~Implementation ( )
inlinevirtual

Destructor.

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

Member Function Documentation

virtual void ns3::Hash::Implementation::clear ( void  )
pure virtual

Restore initial state.

Implemented in ns3::Hash::Function::Hash64, ns3::Hash::Function::Hash32, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.

Referenced by ns3::Hasher::clear().

+ Here is the caller graph for this function:

virtual uint32_t ns3::Hash::Implementation::GetHash32 ( const char *  buffer,
const size_t  size 
)
pure virtual

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

Implemented in ns3::Hash::Function::Hash64, ns3::Hash::Function::Hash32, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.

Referenced by ns3::Hasher::GetHash32(), and GetHash64().

+ Here is the caller graph for this function:

uint64_t ns3::Hash::Implementation::GetHash64 ( const char *  buffer,
const size_t  size 
)
virtual

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 in ns3::Hash::Function::Hash64, ns3::Hash::Function::Fnv1a, and ns3::Hash::Function::Murmur3.

Definition at line 32 of file hash-function.cc.

References GetHash32(), and NS_LOG_WARN.

Referenced by ns3::Hasher::GetHash64().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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