Panda3D
Loading...
Searching...
No Matches
geomCacheEntry.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 geomCacheEntry.I
10 * @author drose
11 * @date 2005-03-21
12 */
13
14/**
15 *
16 */
17INLINE GeomCacheEntry::
18GeomCacheEntry() {
19#ifndef NDEBUG
20 _next = nullptr;
21 _prev = nullptr;
22#endif
23}
24
25/**
26 * Removes a GeomCacheEntry record from the doubly-linked list.
27 */
28INLINE void GeomCacheEntry::
29remove_from_list() {
30 nassertv(_prev->_next == this && _next->_prev == this);
31 _prev->_next = _next;
32 _next->_prev = _prev;
33#ifndef NDEBUG
34 _next = nullptr;
35 _prev = nullptr;
36#endif
37}
38
39/**
40 * Adds a GeomCacheEntry record before the indicated node in the doubly-linked
41 * list.
42 */
43INLINE void GeomCacheEntry::
44insert_before(GeomCacheEntry *node) {
45 nassertv(node->_prev->_next == node && node->_next->_prev == node);
46 nassertv(_prev == nullptr &&
47 _next == nullptr);
48 _prev = node->_prev;
49 _next = node;
50 _prev->_next = this;
51 node->_prev = this;
52}
53
54INLINE std::ostream &
55operator << (std::ostream &out, const GeomCacheEntry &entry) {
56 entry.output(out);
57 return out;
58}
This object contains a single cache entry in the GeomCacheManager.