Panda3D
xFileNode.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 xFileNode.I
10  * @author drose
11  * @date 2004-10-03
12  */
13 
14 /**
15  *
16  */
17 INLINE XFileNode::
18 XFileNode(XFile *x_file) :
19  Namable(),
20  _x_file(x_file)
21 {
22 }
23 
24 /**
25  *
26  */
27 INLINE XFile *XFileNode::
28 get_x_file() const {
29  return _x_file;
30 }
31 
32 /**
33  * Returns the list of children of this node. This list includes templates as
34  * well as data objects.
35  */
36 INLINE int XFileNode::
37 get_num_children() const {
38  return _children.size();
39 }
40 
41 /**
42  * Returns the nth child of this node. This list includes templates as well
43  * as data objects.
44  */
46 get_child(int n) const {
47  nassertr(n >= 0 && n < (int)_children.size(), nullptr);
48  return _children[n];
49 }
50 
51 /**
52  * Returns the list of child objects of this node. This list does not include
53  * template definitions; it is strictly the list of children that are also
54  * data objects (instances of templates).
55  */
56 INLINE int XFileNode::
57 get_num_objects() const {
58  return _objects.size();
59 }
60 
61 /**
62  * Returns the nth child object of this node. This list does not include
63  * template definitions; it is strictly the list of children that are also
64  * data objects (instances of templates).
65  */
67 get_object(int n) const {
68  nassertr(n >= 0 && n < (int)_objects.size(), nullptr);
69  return _objects[n];
70 }
A base class for all things which can have a name.
Definition: namable.h:26
This is an abstract base class for an XFileNode which is also an XFileDataObject.
Definition: xFileDataNode.h:33
A single node of an X file.
Definition: xFileNode.h:40
int get_num_objects() const
Returns the list of child objects of this node.
Definition: xFileNode.I:57
int get_num_children() const
Returns the list of children of this node.
Definition: xFileNode.I:37
XFileDataNode * get_object(int n) const
Returns the nth child object of this node.
Definition: xFileNode.I:67
XFileNode * get_child(int n) const
Returns the nth child of this node.
Definition: xFileNode.I:46
This represents the complete contents of an X file (file.x) in memory.
Definition: xFile.h:32