Panda3D
Loading...
Searching...
No Matches
panda
src
gobj
vertexDataBook.h
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file vertexDataBook.h
10
* @author drose
11
* @date 2007-05-16
12
*/
13
14
#ifndef VERTEXDATABOOK_H
15
#define VERTEXDATABOOK_H
16
17
#include "
pandabase.h
"
18
#include "
pmutex.h
"
19
#include "
mutexHolder.h
"
20
#include "
vertexDataPage.h
"
21
#include "
indirectLess.h
"
22
#include "
plist.h
"
23
24
class
VertexDataBlock
;
25
26
/**
27
* A collection of VertexDataPages, which can be used to allocate new
28
* VertexDataBlock objects.
29
*/
30
class
EXPCL_PANDA_GOBJ
VertexDataBook
{
31
PUBLISHED:
32
explicit
VertexDataBook
(
size_t
block_size);
33
~VertexDataBook
();
34
35
INLINE
VertexDataBlock
*alloc(
size_t
size);
36
37
INLINE
size_t
get_num_pages()
const
;
38
39
size_t
count_total_page_size()
const
;
40
size_t
count_total_page_size(VertexDataPage::RamClass ram_class)
const
;
41
size_t
count_allocated_size()
const
;
42
size_t
count_allocated_size(VertexDataPage::RamClass ram_class)
const
;
43
44
void
save_to_disk();
45
46
public
:
47
void
reorder_page(
VertexDataPage
*page);
48
49
private
:
50
INLINE
VertexDataPage
*create_new_page(
size_t
size);
51
VertexDataBlock
*do_alloc(
size_t
size);
52
53
private
:
54
size_t
_block_size;
55
56
typedef
pset<VertexDataPage *, IndirectLess<VertexDataPage>
>
Pages
;
57
Pages
_pages;
58
59
Mutex
_lock;
60
friend
class
VertexDataPage
;
61
};
62
63
#include "
vertexDataBook.I
"
64
65
#endif
Mutex
A standard mutex, or mutual exclusion lock.
Definition
pmutex.h:40
VertexDataBlock
A block of bytes that stores the actual raw vertex data referenced by a GeomVertexArrayData object.
Definition
vertexDataBlock.h:29
VertexDataBook
A collection of VertexDataPages, which can be used to allocate new VertexDataBlock objects.
Definition
vertexDataBook.h:30
VertexDataPage
A block of bytes that holds one or more VertexDataBlocks.
Definition
vertexDataPage.h:37
pset
This is our own Panda specialization on the default STL set.
Definition
pset.h:49
indirectLess.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
mutexHolder.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
plist.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pmutex.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
vertexDataBook.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
vertexDataPage.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Mon Jan 8 2024 17:18:41 for Panda3D by
1.10.0