A Discrete-Event Network Simulator
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
19namespace ns3
20{
21
23
24Hasher&
26{
27 static Hasher g_hasher = Hasher();
28 g_hasher.clear();
29 return g_hasher;
30}
31
37
43
44Hasher&
46{
47 m_impl->clear();
48 return *this;
49}
50
51} // namespace ns3
Generic Hash function interface.
Definition hash.h:76
Hasher()
Constructor using the default implementation.
Definition hash.cc:32
Ptr< Hash::Implementation > m_impl
Hash implementation.
Definition hash.h:164
Hasher & clear()
Restore initial state.
Definition hash.cc:45
Smart pointer class similar to boost::intrusive_ptr.
#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
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations.
Debug message logging.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hasher & GetStaticHash()
Get a reference to the static global hasher at g_hasher.
Definition hash.cc:25