Panda3D
panda
src
gobj
bufferContextChain.I
1
// Filename: bufferContextChain.I
2
// Created by: drose (16Mar06)
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: BufferContextChain::Constructor
18
// Access: Public
19
// Description:
20
////////////////////////////////////////////////////////////////////
21
INLINE BufferContextChain::
22
BufferContextChain() :
23
LinkedListNode
(true),
// This object is the root of a list of BufferContexts.
24
_total_size(0),
25
_count(0)
26
{
27
}
28
29
////////////////////////////////////////////////////////////////////
30
// Function: BufferContextChain::Destructor
31
// Access: Public
32
// Description:
33
////////////////////////////////////////////////////////////////////
34
INLINE BufferContextChain::
35
~BufferContextChain() {
36
nassertv(_total_size == 0 && _count == 0);
37
}
38
39
////////////////////////////////////////////////////////////////////
40
// Function: BufferContextChain::get_total_size
41
// Access: Public
42
// Description: Returns the total number of bytes represented by the
43
// BufferContexts currently assigned to this tracker.
44
////////////////////////////////////////////////////////////////////
45
INLINE
size_t
BufferContextChain::
46
get_total_size
()
const
{
47
return
_total_size;
48
}
49
50
////////////////////////////////////////////////////////////////////
51
// Function: BufferContextChain::get_count
52
// Access: Public
53
// Description: Returns the total number of BufferContexts currently
54
// assigned to this tracker.
55
////////////////////////////////////////////////////////////////////
56
INLINE
int
BufferContextChain::
57
get_count
()
const
{
58
return
_count;
59
}
60
61
////////////////////////////////////////////////////////////////////
62
// Function: BufferContextChain::adjust_bytes
63
// Access: Private
64
// Description: Adds or removes some from the total byte count.
65
////////////////////////////////////////////////////////////////////
66
INLINE
void
BufferContextChain::
67
adjust_bytes(
int
delta) {
68
_total_size += delta;
69
}
BufferContextChain::get_count
int get_count() const
Returns the total number of BufferContexts currently assigned to this tracker.
Definition:
bufferContextChain.I:57
LinkedListNode
This just stores the pointers to implement a doubly-linked list of some kind of object.
Definition:
linkedListNode.h:35
BufferContextChain::get_total_size
size_t get_total_size() const
Returns the total number of bytes represented by the BufferContexts currently assigned to this tracke...
Definition:
bufferContextChain.I:46
Generated on Wed May 17 2017 23:42:35 for Panda3D by
1.8.13