Panda3D
xFileDataNode.I
1 // Filename: xFileDataNode.I
2 // Created by: drose (08Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: XFileDataNode::get_data_child
18 // Access: Public
19 // Description: Since the children of an XFileDataNode are
20 // syntactically constrained to themselves be
21 // XFileDataNodes, this is a convenience function that
22 // returns the same thing as XFileNode::get_child(), but
23 // it is cast to a type XFileDataNode and dereferenced.
24 ////////////////////////////////////////////////////////////////////
25 INLINE const XFileDataNode &XFileDataNode::
26 get_data_child(int n) const {
27  return *DCAST(XFileDataNode, get_child(n));
28 }
29 
30 
31 ////////////////////////////////////////////////////////////////////
32 // Function: XFileDataNode::get_template
33 // Access: Public
34 // Description: Returns the template used to define this data object.
35 // Since the only classes to inherit from XFileDataNode
36 // are XFileDataNodeTemplate and XFileDataNodeReference,
37 // both of which represent a class that is defined by a
38 // template, it makes sense to put this common method
39 // here in the base class.
40 ////////////////////////////////////////////////////////////////////
42 get_template() const {
43  return _template;
44 }
45 
46 ////////////////////////////////////////////////////////////////////
47 // Function: XFileDataNode::get_template_name
48 // Access: Public
49 // Description: A convenience function to return the name of the
50 // template used to define this data object.
51 ////////////////////////////////////////////////////////////////////
52 INLINE const string &XFileDataNode::
54  return _template->get_name();
55 }
56 
const string & get_template_name() const
A convenience function to return the name of the template used to define this data object...
Definition: xFileDataNode.I:53
XFileTemplate * get_template() const
Returns the template used to define this data object.
Definition: xFileDataNode.I:42
This is an abstract base class for an XFileNode which is also an XFileDataObject. ...
Definition: xFileDataNode.h:36
A template definition in the X file.
Definition: xFileTemplate.h:29
const XFileDataNode & get_data_child(int n) const
Since the children of an XFileDataNode are syntactically constrained to themselves be XFileDataNodes...
Definition: xFileDataNode.I:26
XFileNode * get_child(int n) const
Returns the nth child of this node.
Definition: xFileNode.I:44