Panda3D
|
00001 // Filename: bufferContextChain.I 00002 // Created by: drose (16Mar06) 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: BufferContextChain::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE BufferContextChain:: 00022 BufferContextChain() : 00023 LinkedListNode(true), // This object is the root of a list of BufferContexts. 00024 _total_size(0), 00025 _count(0) 00026 { 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function: BufferContextChain::Destructor 00031 // Access: Public 00032 // Description: 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE BufferContextChain:: 00035 ~BufferContextChain() { 00036 nassertv(_total_size == 0 && _count == 0); 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: BufferContextChain::get_total_size 00041 // Access: Public 00042 // Description: Returns the total number of bytes represented by the 00043 // BufferContexts currently assigned to this tracker. 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE size_t BufferContextChain:: 00046 get_total_size() const { 00047 return _total_size; 00048 } 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: BufferContextChain::get_count 00052 // Access: Public 00053 // Description: Returns the total number of BufferContexts currently 00054 // assigned to this tracker. 00055 //////////////////////////////////////////////////////////////////// 00056 INLINE int BufferContextChain:: 00057 get_count() const { 00058 return _count; 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: BufferContextChain::adjust_bytes 00063 // Access: Private 00064 // Description: Adds or removes some from the total byte count. 00065 //////////////////////////////////////////////////////////////////// 00066 INLINE void BufferContextChain:: 00067 adjust_bytes(int delta) { 00068 _total_size += delta; 00069 }