Panda3D
Loading...
Searching...
No Matches
xFileDataNode.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 xFileDataNode.I
10 * @author drose
11 * @date 2004-10-08
12 */
13
14/**
15 * Since the children of an XFileDataNode are syntactically constrained to
16 * themselves be XFileDataNodes, this is a convenience function that returns
17 * the same thing as XFileNode::get_child(), but it is cast to a type
18 * XFileDataNode and dereferenced.
19 */
21get_data_child(int n) const {
22 return *DCAST(XFileDataNode, get_child(n));
23}
24
25
26/**
27 * Returns the template used to define this data object. Since the only
28 * classes to inherit from XFileDataNode are XFileDataNodeTemplate and
29 * XFileDataNodeReference, both of which represent a class that is defined by
30 * a template, it makes sense to put this common method here in the base
31 * class.
32 */
34get_template() const {
35 return _template;
36}
37
38/**
39 * A convenience function to return the name of the template used to define
40 * this data object.
41 */
42INLINE const std::string &XFileDataNode::
43get_template_name() const {
44 return _template->get_name();
45}
This is an abstract base class for an XFileNode which is also an XFileDataObject.
const XFileDataNode & get_data_child(int n) const
Since the children of an XFileDataNode are syntactically constrained to themselves be XFileDataNodes,...
const std::string & get_template_name() const
A convenience function to return the name of the template used to define this data object.
XFileTemplate * get_template() const
Returns the template used to define this data object.
XFileNode * get_child(int n) const
Returns the nth child of this node.
Definition xFileNode.I:46
A template definition in the X file.