A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
hash.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2012 Lawrence Livermore National Laboratory
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov>
7
*/
8
9
#include "
hash.h
"
10
11
#include "
log.h
"
12
13
/**
14
* \file
15
* \ingroup hash
16
* \brief ns3::Hasher implementation.
17
*/
18
19
namespace
ns3
20
{
21
22
NS_LOG_COMPONENT_DEFINE
(
"Hash"
);
23
24
Hasher&
25
GetStaticHash
()
26
{
27
static
Hasher
g_hasher =
Hasher
();
28
g_hasher.
clear
();
29
return
g_hasher;
30
}
31
32
Hasher::Hasher
()
33
{
34
m_impl
=
Create<Hash::Function::Murmur3>
();
35
NS_ASSERT
(
m_impl
);
36
}
37
38
Hasher::Hasher
(
Ptr<Hash::Implementation>
hp)
39
: m_impl(hp)
40
{
41
NS_ASSERT
(
m_impl
);
42
}
43
44
Hasher
&
45
Hasher::clear
()
46
{
47
m_impl
->
clear
();
48
return
*
this
;
49
}
50
51
}
// namespace ns3
ns3::Hasher
Generic Hash function interface.
Definition
hash.h:76
ns3::Hasher::Hasher
Hasher()
Constructor using the default implementation.
Definition
hash.cc:32
ns3::Hasher::m_impl
Ptr< Hash::Implementation > m_impl
Hash implementation.
Definition
hash.h:164
ns3::Hasher::clear
Hasher & clear()
Restore initial state.
Definition
hash.cc:45
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition
assert.h:55
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
hash.h
ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations.
log.h
Debug message logging.
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::GetStaticHash
Hasher & GetStaticHash()
Get a reference to the static global hasher at g_hasher.
Definition
hash.cc:25
src
core
model
hash.cc
Generated on Wed Oct 9 2024 01:03:22 for ns-3 by
1.11.0