Panda3D
 All Classes Functions Variables Enumerations
vertexDataSaveFile.I
1 // Filename: vertexDataSaveFile.I
2 // Created by: drose (12May07)
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: VertexDataSaveFile::is_valid
18 // Access: Public
19 // Description: Returns true if the save file was successfully
20 // created and is ready for use, false if there was an
21 // error.
22 ////////////////////////////////////////////////////////////////////
23 INLINE bool VertexDataSaveFile::
24 is_valid() const {
25  return _is_valid;
26 }
27 
28 ////////////////////////////////////////////////////////////////////
29 // Function: VertexDataSaveFile::get_total_file_size
30 // Access: Public
31 // Description: Returns the amount of space consumed by the save
32 // file, including unused portions.
33 ////////////////////////////////////////////////////////////////////
34 INLINE size_t VertexDataSaveFile::
36  return _total_file_size;
37 }
38 
39 ////////////////////////////////////////////////////////////////////
40 // Function: VertexDataSaveFile::get_used_file_size
41 // Access: Public
42 // Description: Returns the amount of space within the save file that
43 // is currently in use.
44 ////////////////////////////////////////////////////////////////////
45 INLINE size_t VertexDataSaveFile::
48 }
49 
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: VertexDataSaveBlock::Constructor
53 // Access: Public
54 // Description:
55 ////////////////////////////////////////////////////////////////////
56 INLINE VertexDataSaveBlock::
57 VertexDataSaveBlock(VertexDataSaveFile *file, size_t start, size_t size) :
58  SimpleAllocatorBlock(file, start, size)
59 {
60 }
61 
62 ////////////////////////////////////////////////////////////////////
63 // Function: VertexDataSaveBlock::set_compressed
64 // Access: Public
65 // Description: Sets the compressed flag. This is true to indicate
66 // the data is written in zlib-compressed form to the
67 // save file; false to indicate the data is
68 // uncompressed.
69 ////////////////////////////////////////////////////////////////////
70 INLINE void VertexDataSaveBlock::
71 set_compressed(bool compressed) {
72  _compressed = compressed;
73 }
74 
75 ////////////////////////////////////////////////////////////////////
76 // Function: VertexDataSaveBlock::get_compressed
77 // Access: Public
78 // Description: Returns the compressed flag. This is true to
79 // indicate the data is written in zlib-compressed form
80 // to the save file; false to indicate the data is
81 // uncompressed.
82 ////////////////////////////////////////////////////////////////////
83 INLINE bool VertexDataSaveBlock::
84 get_compressed() const {
85  return _compressed;
86 }
A temporary file to hold the vertex data that has been evicted from memory and written to disk...
size_t get_used_file_size() const
Returns the amount of space within the save file that is currently in use.
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.
A single block as returned from SimpleAllocator::alloc().
size_t get_total_size() const
Returns the total size of allocated objects.
bool get_compressed() const
Returns the compressed flag.
size_t get_total_file_size() const
Returns the amount of space consumed by the save file, including unused portions. ...