Panda3D
Loading...
Searching...
No Matches
pointerToVoid.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file pointerToVoid.I
10 * @author drose
11 * @date 2004-09-27
12 */
13
14/**
15 *
16 */
17//INLINE PointerToVoid::
18//~PointerToVoid() {
19// nassertv(_void_ptr == nullptr);
20//}
21
22/**
23 * Returns true if the PointerTo is a NULL pointer, false otherwise. (Direct
24 * comparison to a NULL pointer also works.)
25 */
26constexpr bool PointerToVoid::
27is_null() const {
28 return _void_ptr == nullptr;
29}
30
31/**
32 *
33 */
34INLINE size_t PointerToVoid::
35get_hash() const {
36 return (size_t)_void_ptr;
37}
38
39/**
40 *
41 */
42INLINE bool PointerToVoid::
43operator < (const void *other) const {
44 return _void_ptr < other;
45}
46
47/**
48 *
49 */
50INLINE bool PointerToVoid::
51operator < (const PointerToVoid &other) const {
52 return _void_ptr < other._void_ptr;
53}
54
55/**
56 *
57 */
58INLINE bool PointerToVoid::
59operator == (const PointerToVoid &other) const {
60 return _void_ptr == other._void_ptr;
61}
62
63/**
64 *
65 */
66INLINE bool PointerToVoid::
67operator != (const PointerToVoid &other) const {
68 return _void_ptr != other._void_ptr;
69}
70
71/**
72 * Swaps the contents of this PointerTo with the other, without touching the
73 * reference counts.
74 *
75 * For internal use only. Use the global swap() function instead.
76 */
77INLINE void PointerToVoid::
78swap(PointerToVoid &other) noexcept {
79 AtomicAdjust::Pointer temp = _void_ptr;
80 _void_ptr = other._void_ptr;
81 other._void_ptr = temp;
82}
This is the non-template part of the base class for PointerTo and ConstPointerTo.
constexpr bool is_null() const
Returns true if the PointerTo is a NULL pointer, false otherwise.
void swap(PointerToVoid &other) noexcept
Swaps the contents of this PointerTo with the other, without touching the reference counts.