00001 // Filename: xFileArrayDef.I 00002 // Created by: drose (03Oct04) 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: XFileArrayDef::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE XFileArrayDef:: 00022 XFileArrayDef(int fixed_size) : 00023 _fixed_size(fixed_size), 00024 _dynamic_size(NULL) 00025 { 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: XFileArrayDef::Constructor 00030 // Access: Public 00031 // Description: 00032 //////////////////////////////////////////////////////////////////// 00033 INLINE XFileArrayDef:: 00034 XFileArrayDef(XFileDataDef *dynamic_size) : 00035 _fixed_size(0), 00036 _dynamic_size(dynamic_size) 00037 { 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function: XFileArrayDef::is_fixed_size 00042 // Access: Public 00043 // Description: Returns true if this array definition specifies a 00044 // const-size array, false if it is a dynamic-size 00045 // array. 00046 //////////////////////////////////////////////////////////////////// 00047 INLINE bool XFileArrayDef:: 00048 is_fixed_size() const { 00049 return (_dynamic_size == (XFileDataDef *)NULL); 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: XFileArrayDef::get_fixed_size 00054 // Access: Public 00055 // Description: Returns the const size of the array, if 00056 // is_fixed_size() returned true. 00057 //////////////////////////////////////////////////////////////////// 00058 INLINE int XFileArrayDef:: 00059 get_fixed_size() const { 00060 nassertr(is_fixed_size(), 0); 00061 return _fixed_size; 00062 } 00063 00064 //////////////////////////////////////////////////////////////////// 00065 // Function: XFileArrayDef::get_dynamic_size 00066 // Access: Public 00067 // Description: Returns the data element that names the dynamic size 00068 // of the array, if is_fixed_size() returned false. 00069 //////////////////////////////////////////////////////////////////// 00070 INLINE XFileDataDef *XFileArrayDef:: 00071 get_dynamic_size() const { 00072 nassertr(!is_fixed_size(), NULL); 00073 return _dynamic_size; 00074 } 00075