00001 // Filename: xFileDataNode.I 00002 // Created by: drose (08Oct04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: XFileDataNode::get_data_child 00018 // Access: Public 00019 // Description: Since the children of an XFileDataNode are 00020 // syntactically constrained to themselves be 00021 // XFileDataNodes, this is a convenience function that 00022 // returns the same thing as XFileNode::get_child(), but 00023 // it is cast to a type XFileDataNode and dereferenced. 00024 //////////////////////////////////////////////////////////////////// 00025 INLINE const XFileDataNode &XFileDataNode:: 00026 get_data_child(int n) const { 00027 return *DCAST(XFileDataNode, get_child(n)); 00028 } 00029 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Function: XFileDataNode::get_template 00033 // Access: Public 00034 // Description: Returns the template used to define this data object. 00035 // Since the only classes to inherit from XFileDataNode 00036 // are XFileDataNodeTemplate and XFileDataNodeReference, 00037 // both of which represent a class that is defined by a 00038 // template, it makes sense to put this common method 00039 // here in the base class. 00040 //////////////////////////////////////////////////////////////////// 00041 INLINE XFileTemplate *XFileDataNode:: 00042 get_template() const { 00043 return _template; 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: XFileDataNode::get_template_name 00048 // Access: Public 00049 // Description: A convenience function to return the name of the 00050 // template used to define this data object. 00051 //////////////////////////////////////////////////////////////////// 00052 INLINE const string &XFileDataNode:: 00053 get_template_name() const { 00054 return _template->get_name(); 00055 } 00056