Panda3D

pipelineCyclerLinks.I

00001 // Filename: pipelineCyclerLinks.I
00002 // Created by:  drose (16Feb06)
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 #ifdef THREADED_PIPELINE
00017 ////////////////////////////////////////////////////////////////////
00018 //     Function: PipelineCyclerLinks::Constructor
00019 //       Access: Protected
00020 //  Description: 
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE PipelineCyclerLinks::
00023 PipelineCyclerLinks() {
00024 #ifndef NDEBUG
00025   _next = NULL;
00026   _prev = NULL;
00027 #endif
00028 }
00029 #endif  // THREADED_PIPELINE
00030 
00031 #ifdef THREADED_PIPELINE
00032 ////////////////////////////////////////////////////////////////////
00033 //     Function: PipelineCyclerLinks::Destructor
00034 //       Access: Protected
00035 //  Description: 
00036 ////////////////////////////////////////////////////////////////////
00037 INLINE PipelineCyclerLinks::
00038 ~PipelineCyclerLinks() {
00039   nassertv(_next == NULL && _prev == NULL);
00040 }
00041 #endif  // THREADED_PIPELINE
00042 
00043 #ifdef THREADED_PIPELINE
00044 ////////////////////////////////////////////////////////////////////
00045 //     Function: PipelineCyclerLinks::remove_from_list
00046 //       Access: Protected
00047 //  Description: Removes a PipelineCyclerLinks record from the
00048 //               doubly-linked list.
00049 ////////////////////////////////////////////////////////////////////
00050 INLINE void PipelineCyclerLinks::
00051 remove_from_list() {
00052   nassertv(_prev->_next == this && _next->_prev == this);
00053   _prev->_next = _next;
00054   _next->_prev = _prev;
00055 #ifndef NDEBUG
00056   _next = NULL;
00057   _prev = NULL;
00058 #endif
00059 }
00060 #endif  // THREADED_PIPELINE
00061 
00062 #ifdef THREADED_PIPELINE
00063 ////////////////////////////////////////////////////////////////////
00064 //     Function: PipelineCyclerLinks::insert_before
00065 //       Access: Protected
00066 //  Description: Adds a PipelineCyclerLinks record before the indicated
00067 //               node in the doubly-linked list.
00068 ////////////////////////////////////////////////////////////////////
00069 INLINE void PipelineCyclerLinks::
00070 insert_before(PipelineCyclerLinks *node) {
00071   nassertv(node->_prev->_next == node && node->_next->_prev == node);
00072   nassertv(_prev == (PipelineCyclerLinks *)NULL &&
00073            _next == (PipelineCyclerLinks *)NULL);
00074   _prev = node->_prev;
00075   _next = node;
00076   _prev->_next = this;
00077   node->_prev = this;
00078 }
00079 #endif  // THREADED_PIPELINE
 All Classes Functions Variables Enumerations