Panda3D
xFileDataDef.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file xFileDataDef.I
10  * @author drose
11  * @date 2004-10-03
12  */
13 
14 /**
15  *
16  */
17 INLINE XFileDataDef::
18 XFileDataDef(XFile *x_file, const std::string &name,
19  XFileDataDef::Type type, XFileTemplate *xtemplate) :
20  XFileNode(x_file, name),
21  _type(type),
22  _template(xtemplate)
23 {
24 }
25 
26 /**
27  * Returns the primitive type of this element, or T_template if this
28  * represents a nested template object.
29  */
30 INLINE XFileDataDef::Type XFileDataDef::
31 get_data_type() const {
32  return _type;
33 }
34 
35 /**
36  * If get_data_type() returned T_template, this returns the particular
37  * template pointer that this object represents.
38  */
40 get_template() const {
41  return _template;
42 }
43 
44 /**
45  * Returns the number of dimensions of array elements on this data object, or
46  * 0 if the data object is not an array.
47  */
48 INLINE int XFileDataDef::
50  return _array_def.size();
51 }
52 
53 /**
54  * Returns the description of the nth dimension of array elements on this data
55  * object.
56  */
57 INLINE const XFileArrayDef &XFileDataDef::
58 get_array_def(int i) const {
59  nassertr(i >= 0 && i < (int)_array_def.size(), _array_def[0]);
60  return _array_def[i];
61 }
Defines one level of array bounds for an associated XFileDataDef element.
Definition: xFileArrayDef.h:26
int get_num_array_defs() const
Returns the number of dimensions of array elements on this data object, or 0 if the data object is no...
Definition: xFileDataDef.I:49
Type get_data_type() const
Returns the primitive type of this element, or T_template if this represents a nested template object...
Definition: xFileDataDef.I:31
A single node of an X file.
Definition: xFileNode.h:39
XFileTemplate * get_template() const
If get_data_type() returned T_template, this returns the particular template pointer that this object...
Definition: xFileDataDef.I:40
This represents the complete contents of an X file (file.x) in memory.
Definition: xFile.h:32
A template definition in the X file.
Definition: xFileTemplate.h:27
const XFileArrayDef & get_array_def(int i) const
Returns the description of the nth dimension of array elements on this data object.
Definition: xFileDataDef.I:58