Panda3D

vertexDataSaveFile.I

00001 // Filename: vertexDataSaveFile.I
00002 // Created by:  drose (12May07)
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: VertexDataSaveFile::is_valid
00018 //       Access: Public
00019 //  Description: Returns true if the save file was successfully
00020 //               created and is ready for use, false if there was an
00021 //               error.
00022 ////////////////////////////////////////////////////////////////////
00023 INLINE bool VertexDataSaveFile::
00024 is_valid() const {
00025   return _is_valid;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: VertexDataSaveFile::get_total_file_size
00030 //       Access: Public
00031 //  Description: Returns the amount of space consumed by the save
00032 //               file, including unused portions.
00033 ////////////////////////////////////////////////////////////////////
00034 INLINE size_t VertexDataSaveFile::
00035 get_total_file_size() const {
00036   return _total_file_size;
00037 }
00038 
00039 ////////////////////////////////////////////////////////////////////
00040 //     Function: VertexDataSaveFile::get_used_file_size
00041 //       Access: Public
00042 //  Description: Returns the amount of space within the save file that
00043 //               is currently in use.
00044 ////////////////////////////////////////////////////////////////////
00045 INLINE size_t VertexDataSaveFile::
00046 get_used_file_size() const {
00047   return SimpleAllocator::get_total_size();
00048 }
00049 
00050 
00051 ////////////////////////////////////////////////////////////////////
00052 //     Function: VertexDataSaveBlock::Constructor
00053 //       Access: Public
00054 //  Description: 
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE VertexDataSaveBlock::
00057 VertexDataSaveBlock(VertexDataSaveFile *file, size_t start, size_t size) :
00058   SimpleAllocatorBlock(file, start, size)
00059 {
00060 }
00061 
00062 ////////////////////////////////////////////////////////////////////
00063 //     Function: VertexDataSaveBlock::set_compressed
00064 //       Access: Public
00065 //  Description: Sets the compressed flag.  This is true to indicate
00066 //               the data is written in zlib-compressed form to the
00067 //               save file; false to indicate the data is
00068 //               uncompressed.
00069 ////////////////////////////////////////////////////////////////////
00070 INLINE void VertexDataSaveBlock::
00071 set_compressed(bool compressed) {
00072   _compressed = compressed;
00073 }
00074 
00075 ////////////////////////////////////////////////////////////////////
00076 //     Function: VertexDataSaveBlock::get_compressed
00077 //       Access: Public
00078 //  Description: Returns the compressed flag.  This is true to
00079 //               indicate the data is written in zlib-compressed form
00080 //               to the save file; false to indicate the data is
00081 //               uncompressed.
00082 ////////////////////////////////////////////////////////////////////
00083 INLINE bool VertexDataSaveBlock::
00084 get_compressed() const {
00085   return _compressed;
00086 }
 All Classes Functions Variables Enumerations