Panda3D
 All Classes Functions Variables Enumerations
geomCacheEntry.I
1 // Filename: geomCacheEntry.I
2 // Created by: drose (21Mar05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GeomCacheEntry::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE GeomCacheEntry::
22 GeomCacheEntry() {
23 #ifndef NDEBUG
24  _next = NULL;
25  _prev = NULL;
26 #endif
27 }
28 
29 ////////////////////////////////////////////////////////////////////
30 // Function: GeomCacheEntry::remove_from_list
31 // Access: Private
32 // Description: Removes a GeomCacheEntry record from the
33 // doubly-linked list.
34 ////////////////////////////////////////////////////////////////////
35 INLINE void GeomCacheEntry::
36 remove_from_list() {
37  nassertv(_prev->_next == this && _next->_prev == this);
38  _prev->_next = _next;
39  _next->_prev = _prev;
40 #ifndef NDEBUG
41  _next = NULL;
42  _prev = NULL;
43 #endif
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: GeomCacheEntry::insert_before
48 // Access: Private
49 // Description: Adds a GeomCacheEntry record before the indicated
50 // node in the doubly-linked list.
51 ////////////////////////////////////////////////////////////////////
52 INLINE void GeomCacheEntry::
53 insert_before(GeomCacheEntry *node) {
54  nassertv(node->_prev->_next == node && node->_next->_prev == node);
55  nassertv(_prev == (GeomCacheEntry *)NULL &&
56  _next == (GeomCacheEntry *)NULL);
57  _prev = node->_prev;
58  _next = node;
59  _prev->_next = this;
60  node->_prev = this;
61 }
62 
63 INLINE ostream &
64 operator << (ostream &out, const GeomCacheEntry &entry) {
65  entry.output(out);
66  return out;
67 }
68 
This object contains a single cache entry in the GeomCacheManager.