Panda3D
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  */
20 INLINE const XFileDataNode &XFileDataNode::
21 get_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  */
34 get_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  */
42 INLINE const std::string &XFileDataNode::
44  return _template->get_name();
45 }
XFileTemplate * get_template() const
Returns the template used to define this data object.
Definition: xFileDataNode.I:34
const std::string & get_template_name() const
A convenience function to return the name of the template used to define this data object.
Definition: xFileDataNode.I:43
This is an abstract base class for an XFileNode which is also an XFileDataObject.
Definition: xFileDataNode.h:33
A template definition in the X file.
Definition: xFileTemplate.h:27
const XFileDataNode & get_data_child(int n) const
Since the children of an XFileDataNode are syntactically constrained to themselves be XFileDataNodes,...
Definition: xFileDataNode.I:21
XFileNode * get_child(int n) const
Returns the nth child of this node.
Definition: xFileNode.I:36