A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
default-deleter.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef DEFAULT_DELETER_H
9#define DEFAULT_DELETER_H
10
11/**
12 * \file
13 * \ingroup ptr
14 * ns3::DefaultDeleter declaration and template implementation,
15 * for reference-counted smart pointers.
16 */
17
18namespace ns3
19{
20
21/**
22 * \ingroup ptr
23 * \brief A template used to delete objects
24 * by the ns3::SimpleRefCount templates when the
25 * last reference to an object they manage
26 * disappears.
27 *
28 * \tparam T \deduced The object type being deleted.
29 * \sa ns3::SimpleRefCount
30 */
31template <typename T>
33{
34 /**
35 * The default deleter implementation, which just does a normal
36 * \code
37 * delete object;
38 * \endcode
39 * \tparam T \deduced The object type being deleted.
40 * \param [in] object The object to delete.
41 */
42 inline static void Delete(T* object)
43 {
44 delete object;
45 }
46};
47
48} // namespace ns3
49
50#endif /* DEFAULT_DELETER_H */
Every class exported by the ns3 library is enclosed in the ns3 namespace.
A template used to delete objects by the ns3::SimpleRefCount templates when the last reference to an ...
static void Delete(T *object)
The default deleter implementation, which just does a normal.