Panda3D

dcPackerCatalog.I

00001 // Filename: dcPackerCatalog.I
00002 // Created by:  drose (21Jun04)
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: DCPackerCatalog::LiveCatalog::get_begin
00018 //       Access: Public
00019 //  Description: Returns the beginning of the indicated field within
00020 //               the live data.
00021 ////////////////////////////////////////////////////////////////////
00022 INLINE size_t DCPackerCatalog::LiveCatalog::
00023 get_begin(int n) const {
00024   nassertr(n >= 0 && n < (int)_live_entries.size(), 0);
00025   return _live_entries[n]._begin;
00026 }
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //     Function: DCPackerCatalog::LiveCatalog::get_end
00030 //       Access: Public
00031 //  Description: Returns the end of the indicated field (the byte
00032 //               position of the first following field) within the
00033 //               live data.
00034 ////////////////////////////////////////////////////////////////////
00035 INLINE size_t DCPackerCatalog::LiveCatalog::
00036 get_end(int n) const {
00037   nassertr(n >= 0 && n < (int)_live_entries.size(), 0);
00038   return _live_entries[n]._end;
00039 }
00040 
00041 ////////////////////////////////////////////////////////////////////
00042 //     Function: DCPackerCatalog::LiveCatalog::get_num_entries
00043 //       Access: Public
00044 //  Description: Returns the number of entries in the catalog.
00045 ////////////////////////////////////////////////////////////////////
00046 INLINE int DCPackerCatalog::LiveCatalog::
00047 get_num_entries() const {
00048   return _catalog->get_num_entries();
00049 }
00050 
00051 ////////////////////////////////////////////////////////////////////
00052 //     Function: DCPackerCatalog::LiveCatalog::get_entry
00053 //       Access: Public
00054 //  Description: Returns the nth entry in the catalog.
00055 ////////////////////////////////////////////////////////////////////
00056 INLINE const DCPackerCatalog::Entry &DCPackerCatalog::LiveCatalog::
00057 get_entry(int n) const {
00058   return _catalog->get_entry(n);
00059 }
00060 
00061 ////////////////////////////////////////////////////////////////////
00062 //     Function: DCPackerCatalog::LiveCatalog::find_entry_by_name
00063 //       Access: Public
00064 //  Description: Returns the index number of the entry with the
00065 //               indicated name, or -1 if no entry has the indicated
00066 //               name.  The return value is suitable for passing to
00067 //               get_entry().
00068 ////////////////////////////////////////////////////////////////////
00069 int DCPackerCatalog::LiveCatalog::
00070 find_entry_by_name(const string &name) const {
00071   return _catalog->find_entry_by_name(name);
00072 }
00073 
00074 ////////////////////////////////////////////////////////////////////
00075 //     Function: DCPackerCatalog::LiveCatalog::find_entry_by_field
00076 //       Access: Public
00077 //  Description: Returns the index number of the entry with the
00078 //               indicated field, or -1 if no entry has the indicated
00079 //               field.  The return value is suitable for passing to
00080 //               get_entry().
00081 ////////////////////////////////////////////////////////////////////
00082 int DCPackerCatalog::LiveCatalog::
00083 find_entry_by_field(const DCPackerInterface *field) const {
00084   return _catalog->find_entry_by_field(field);
00085 }
00086 
00087 ////////////////////////////////////////////////////////////////////
00088 //     Function: DCPackerCatalog::get_num_entries
00089 //       Access: Public
00090 //  Description: Returns the number of entries in the catalog.
00091 ////////////////////////////////////////////////////////////////////
00092 INLINE int DCPackerCatalog::
00093 get_num_entries() const {
00094   return _entries.size();
00095 }
00096 
00097 ////////////////////////////////////////////////////////////////////
00098 //     Function: DCPackerCatalog::get_entry
00099 //       Access: Public
00100 //  Description: Returns the nth entry in the catalog.
00101 ////////////////////////////////////////////////////////////////////
00102 INLINE const DCPackerCatalog::Entry &DCPackerCatalog::
00103 get_entry(int n) const {
00104   nassertr(n >= 0 && n < (int)_entries.size(), _entries[0]);
00105   return _entries[n];
00106 }
 All Classes Functions Variables Enumerations