Panda3D
vertexDataSaveFile.I
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 vertexDataSaveFile.I
10  * @author drose
11  * @date 2007-05-12
12  */
13 
14 /**
15  * Returns true if the save file was successfully created and is ready for
16  * use, false if there was an error.
17  */
18 INLINE bool VertexDataSaveFile::
19 is_valid() const {
20  return _is_valid;
21 }
22 
23 /**
24  * Returns the amount of space consumed by the save file, including unused
25  * portions.
26  */
27 INLINE size_t VertexDataSaveFile::
29  return _total_file_size;
30 }
31 
32 /**
33  * Returns the amount of space within the save file that is currently in use.
34  */
35 INLINE size_t VertexDataSaveFile::
38 }
39 
40 
41 /**
42  *
43  */
44 INLINE VertexDataSaveBlock::
45 VertexDataSaveBlock(VertexDataSaveFile *file, size_t start, size_t size) :
46  SimpleAllocatorBlock(file, start, size)
47 {
48 }
49 
50 /**
51  * Sets the compressed flag. This is true to indicate the data is written in
52  * zlib-compressed form to the save file; false to indicate the data is
53  * uncompressed.
54  */
55 INLINE void VertexDataSaveBlock::
56 set_compressed(bool compressed) {
57  _compressed = compressed;
58 }
59 
60 /**
61  * Returns the compressed flag. This is true to indicate the data is written
62  * in zlib-compressed form to the save file; false to indicate the data is
63  * uncompressed.
64  */
65 INLINE bool VertexDataSaveBlock::
66 get_compressed() const {
67  return _compressed;
68 }
A temporary file to hold the vertex data that has been evicted from memory and written to disk.
bool is_valid() const
Returns true if the save file was successfully created and is ready for use, false if there was an er...
void set_compressed(bool compressed)
Sets the compressed flag.
size_t get_total_file_size() const
Returns the amount of space consumed by the save file, including unused portions.
bool get_compressed() const
Returns the compressed flag.
A single block as returned from SimpleAllocator::alloc().
size_t get_used_file_size() const
Returns the amount of space within the save file that is currently in use.
size_t get_total_size() const
Returns the total size of allocated objects.