Panda3D
|
00001 // Filename: xFileDataDef.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: XFileDataDef::Constructor 00018 // Access: Public 00019 // Description: 00020 //////////////////////////////////////////////////////////////////// 00021 INLINE XFileDataDef:: 00022 XFileDataDef(XFile *x_file, const string &name, 00023 XFileDataDef::Type type, XFileTemplate *xtemplate) : 00024 XFileNode(x_file, name), 00025 _type(type), 00026 _template(xtemplate) 00027 { 00028 } 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Function: XFileDataDef::get_data_type 00032 // Access: Public 00033 // Description: Returns the primitive type of this element, or 00034 // T_template if this represents a nested template 00035 // object. 00036 //////////////////////////////////////////////////////////////////// 00037 INLINE XFileDataDef::Type XFileDataDef:: 00038 get_data_type() const { 00039 return _type; 00040 } 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: XFileDataDef::get_template 00044 // Access: Public 00045 // Description: If get_data_type() returned T_template, this returns 00046 // the particular template pointer that this object 00047 // represents. 00048 //////////////////////////////////////////////////////////////////// 00049 INLINE XFileTemplate *XFileDataDef:: 00050 get_template() const { 00051 return _template; 00052 } 00053 00054 //////////////////////////////////////////////////////////////////// 00055 // Function: XFileDataDef::get_num_array_defs 00056 // Access: Public 00057 // Description: Returns the number of dimensions of array elements on 00058 // this data object, or 0 if the data object is not an 00059 // array. 00060 //////////////////////////////////////////////////////////////////// 00061 INLINE int XFileDataDef:: 00062 get_num_array_defs() const { 00063 return _array_def.size(); 00064 } 00065 00066 //////////////////////////////////////////////////////////////////// 00067 // Function: XFileDataDef::get_array_def 00068 // Access: Public 00069 // Description: Returns the description of the nth dimension of array 00070 // elements on this data object. 00071 //////////////////////////////////////////////////////////////////// 00072 INLINE const XFileArrayDef &XFileDataDef:: 00073 get_array_def(int i) const { 00074 nassertr(i >= 0 && i < (int)_array_def.size(), _array_def[0]); 00075 return _array_def[i]; 00076 }