Panda3D
Loading...
Searching...
No Matches
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 */
17INLINE XFileDataDef::
18XFileDataDef(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 */
30INLINE XFileDataDef::Type XFileDataDef::
31get_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 */
40get_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 */
49get_num_array_defs() const {
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 */
58get_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.
Type get_data_type() const
Returns the primitive type of this element, or T_template if this represents a nested template object...
const XFileArrayDef & get_array_def(int i) const
Returns the description of the nth dimension of array elements on this data object.
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...
XFileTemplate * get_template() const
If get_data_type() returned T_template, this returns the particular template pointer that this object...
A single node of an X file.
Definition xFileNode.h:40
A template definition in the X file.
This represents the complete contents of an X file (file.x) in memory.
Definition xFile.h:32