Panda3D
 All Classes Functions Variables Enumerations
geomCacheEntry.I
00001 // Filename: geomCacheEntry.I
00002 // Created by:  drose (21Mar05)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 
00016 ////////////////////////////////////////////////////////////////////
00017 //     Function: GeomCacheEntry::Constructor
00018 //       Access: Public
00019 //  Description: 
00020 ////////////////////////////////////////////////////////////////////
00021 INLINE GeomCacheEntry::
00022 GeomCacheEntry() {
00023 #ifndef NDEBUG
00024   _next = NULL;
00025   _prev = NULL;
00026 #endif
00027 }
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //     Function: GeomCacheEntry::remove_from_list
00031 //       Access: Private
00032 //  Description: Removes a GeomCacheEntry record from the
00033 //               doubly-linked list.
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE void GeomCacheEntry::
00036 remove_from_list() {
00037   nassertv(_prev->_next == this && _next->_prev == this);
00038   _prev->_next = _next;
00039   _next->_prev = _prev;
00040 #ifndef NDEBUG
00041   _next = NULL;
00042   _prev = NULL;
00043 #endif
00044 }
00045 
00046 ////////////////////////////////////////////////////////////////////
00047 //     Function: GeomCacheEntry::insert_before
00048 //       Access: Private
00049 //  Description: Adds a GeomCacheEntry record before the indicated
00050 //               node in the doubly-linked list.
00051 ////////////////////////////////////////////////////////////////////
00052 INLINE void GeomCacheEntry::
00053 insert_before(GeomCacheEntry *node) {
00054   nassertv(node->_prev->_next == node && node->_next->_prev == node);
00055   nassertv(_prev == (GeomCacheEntry *)NULL &&
00056            _next == (GeomCacheEntry *)NULL);
00057   _prev = node->_prev;
00058   _next = node;
00059   _prev->_next = this;
00060   node->_prev = this;
00061 }
00062 
00063 INLINE ostream &
00064 operator << (ostream &out, const GeomCacheEntry &entry) {
00065   entry.output(out);
00066   return out;
00067 }
00068 
 All Classes Functions Variables Enumerations